avcodec/mpegaudioenc_template: fix invalid shift of sample

Fixes: Ticket8010

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2020-01-23 12:41:41 +01:00
parent e13eee37ee
commit a2c97a8342
1 changed files with 1 additions and 1 deletions

View File

@ -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;