From d9dd4992da714aabcc8a3eafa5fcae1c21c50a71 Mon Sep 17 00:00:00 2001 From: Gregory Maxwell <greg@xiph.org> Date: Sun, 16 Oct 2011 04:02:02 -0400 Subject: [PATCH] Correct rare mismatch between the encoder and decoder introduced by e9b53212. Only one of the two required checks in the encoder were updated. Thanks to Tim for tracking down the actual cause of the mismatch. --- src/opus_encoder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/opus_encoder.c b/src/opus_encoder.c index bb846793e..ab607e7da 100644 --- a/src/opus_encoder.c +++ b/src/opus_encoder.c @@ -930,7 +930,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)) { /* 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)) ec_enc_bit_logp(&enc, redundancy, 12); if (redundancy) { -- GitLab