From: Andreas Rheinhardt Date: Thu, 19 Sep 2019 22:17:06 +0000 (+0200) Subject: avcodec/ac3enc: Fix invalid shift X-Git-Tag: n4.4-dev~3092 X-Git-Url: http://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff_plain/2f289ec914cc7e8133858d4f9e8d91dab685ae44?ds=sidebyside avcodec/ac3enc: Fix invalid shift Fixes the FATE-tests unknown_layout-ac3, ac3-fixed-encode, ac3-encode and eac3-encode. It furthermore fixes the ac3-encoder bugs mentioned in tickets #7994, #8144 and #8159. Signed-off-by: Andreas Rheinhardt Signed-off-by: Michael Niedermayer --- diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c index f1c95ce..76872a8 100644 --- a/libavcodec/ac3enc.c +++ b/libavcodec/ac3enc.c @@ -1065,7 +1065,7 @@ static int bit_alloc(AC3EncodeContext *s, int snr_offset) { int blk, ch; - snr_offset = (snr_offset - 240) << 2; + snr_offset = (snr_offset - 240) * 4; reset_block_bap(s); for (blk = 0; blk < s->num_blocks; blk++) {