Skip to content
Snippets Groups Projects
Commit e9b53212 authored by Jean-Marc Valin's avatar Jean-Marc Valin
Browse files

Tim says it's safe

parent ab964575
No related branches found
No related tags found
No related merge requests found
...@@ -321,7 +321,7 @@ static int opus_decode_frame(OpusDecoder *st, const unsigned char *data, ...@@ -321,7 +321,7 @@ static int opus_decode_frame(OpusDecoder *st, const unsigned char *data,
} }
start_band = 0; 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 */ /* Check if we have a redundant 0-8 kHz band */
if (mode == MODE_HYBRID) if (mode == MODE_HYBRID)
......
...@@ -918,7 +918,7 @@ int opus_encode_float(OpusEncoder *st, const opus_val16 *pcm, int frame_size, ...@@ -918,7 +918,7 @@ int opus_encode_float(OpusEncoder *st, const opus_val16 *pcm, int frame_size,
} }
} }
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 */ /* For SILK mode, the redundancy is inferred from the length */
if (st->mode == MODE_HYBRID && (redundancy || ec_tell(&enc)+37 < 8*nb_compr_bytes)) if (st->mode == MODE_HYBRID && (redundancy || ec_tell(&enc)+37 < 8*nb_compr_bytes))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment