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:
parent
b382d09d29
commit
9f630e8346
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user