1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-15 14:13:16 +02:00

avcodec/mpegaudioenc_template: Fix integer overflow

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer
2014-04-15 15:09:57 +02:00
parent 4615ff0d61
commit c6902f96d7

View File

@@ -708,7 +708,7 @@ static void encode_frame(MpegAudioContext *s,
q1 += 1 << P; q1 += 1 << P;
if (q1 < 0) if (q1 < 0)
q1 = 0; q1 = 0;
q[m] = (unsigned)(q1 * steps) >> (P + 1); q[m] = (q1 * (unsigned)steps) >> (P + 1);
} }
#endif #endif
if (q[m] >= steps) if (q[m] >= steps)