ref: e9b53212f2ad1ee7dbf44d941c15013e23cec932
parent: ab96457554e3fa70f96948059a800500c90ead4c
author: Jean-Marc Valin <[email protected]>
date: Thu Oct 13 12:24:11 EDT 2011
Tim says it's safe
--- a/src/opus_decoder.c
+++ b/src/opus_decoder.c
@@ -321,7 +321,7 @@
}
start_band = 0;
- if (!decode_fec && mode != MODE_CELT_ONLY && data != NULL && ec_tell(&dec)+17+20*(st->mode == MODE_HYBRID) < 8*len)
+ if (!decode_fec && mode != MODE_CELT_ONLY && data != NULL && ec_tell(&dec)+17+20*(st->mode == MODE_HYBRID) <= 8*len)
{
/* Check if we have a redundant 0-8 kHz band */
if (mode == MODE_HYBRID)
--- a/src/opus_encoder.c
+++ b/src/opus_encoder.c
@@ -918,7 +918,7 @@
}
}
- if ( st->mode != MODE_CELT_ONLY && ec_tell(&enc)+17+20*(st->mode == MODE_HYBRID) < 8*(max_data_bytes-1))
+ if ( st->mode != MODE_CELT_ONLY && ec_tell(&enc)+17+20*(st->mode == MODE_HYBRID) <= 8*(max_data_bytes-1))
{
/* For SILK mode, the redundancy is inferred from the length */
if (st->mode == MODE_HYBRID && (redundancy || ec_tell(&enc)+37 < 8*nb_compr_bytes))