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;
if (q1 < 0)
q1 = 0;
q[m] = (unsigned)(q1 * steps) >> (P + 1);
q[m] = (q1 * (unsigned)steps) >> (P + 1);
}
#endif
if (q[m] >= steps)