Commit 9f630e83 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/mpegaudioenc: prevent overflow in fixed point code

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent b382d09d
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment