1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avcodec/mpegaudioenc: prevent overflow in fixed point code

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-11-17 21:14:15 +01:00
parent b382d09d29
commit 9f630e8346

View File

@ -704,6 +704,8 @@ static void encode_frame(MpegAudioContext *s,
q1 = sample >> shift;
q1 = (q1 * mult) >> P;
q[m] = ((q1 + (1 << P)) * steps) >> (P + 1);
if (q[m] < 0)
q[m] = 0;
}
#endif
if (q[m] >= steps)