diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-11-17 21:14:15 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-11-17 21:14:15 +0100 |
commit | 9f630e8346707c093ac47cbe04384ab89ecd693a (patch) | |
tree | 63cdfff70c161fbb995acaed79ad6d01802e2f61 | |
parent | b382d09d29be90e0947295a70cdcbaa60b9030b8 (diff) | |
download | ffmpeg-9f630e8346707c093ac47cbe04384ab89ecd693a.tar.gz |
avcodec/mpegaudioenc: prevent overflow in fixed point code
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/mpegaudioenc.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/mpegaudioenc.c b/libavcodec/mpegaudioenc.c index 005401946e..133c9dcc1d 100644 --- a/libavcodec/mpegaudioenc.c +++ b/libavcodec/mpegaudioenc.c @@ -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) |