aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-01-23 12:41:41 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2020-07-02 19:55:09 +0200
commit2e893054bf32b80c32256152f8d4fa7e9d4186ec (patch)
tree5546178020f72621c8750bb30b73439451aadfd6
parent3a2dfcf3a1f3b601e92db135742c033440499db0 (diff)
downloadffmpeg-2e893054bf32b80c32256152f8d4fa7e9d4186ec.tar.gz
avcodec/mpegaudioenc_template: fix invalid shift of sample
Fixes: Ticket8010 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit a2c97a8342fab6393280cc2f0e2ffb39c381d29c) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/mpegaudioenc_template.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/mpegaudioenc_template.c b/libavcodec/mpegaudioenc_template.c
index 93363fe1d2..12f7a098e6 100644
--- a/libavcodec/mpegaudioenc_template.c
+++ b/libavcodec/mpegaudioenc_template.c
@@ -701,7 +701,7 @@ static void encode_frame(MpegAudioContext *s,
/* normalize to P bits */
if (shift < 0)
- q1 = sample << (-shift);
+ q1 = sample * (1 << -shift);
else
q1 = sample >> shift;
q1 = (q1 * mult) >> P;