diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2010-12-22 00:18:58 +0300 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2010-12-22 00:18:58 +0300 |
commit | 295ab2af6ef556c37633fc2004ec6b434dcc0113 (patch) | |
tree | 68ae2d27329dadc9c48275688d392c6c1f1a6042 /libavcodec/ac3enc.c | |
parent | f9f69028af9f09bd56a1c07f60a42643860e97c4 (diff) |
Change FIX15() back to clipping to -32767..32767.
This avoids a 16-bit overflow in mdct512() due to a -32768 value in costab.
References updated for acodec-ac3, lavf-rm, and seek-ac3_rm tests.
Thanks to Måns Rullgård for finding the bug.
Originally committed as revision 26071 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/ac3enc.c')
-rw-r--r-- | libavcodec/ac3enc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c index 15a2c07438..200fff4878 100644 --- a/libavcodec/ac3enc.c +++ b/libavcodec/ac3enc.c @@ -44,7 +44,7 @@ #define SCALE_FLOAT(a, bits) lrintf((a) * (float)(1 << (bits))) /** Scale a float value by 2^15, convert to an integer, and clip to int16_t range. */ -#define FIX15(a) av_clip_int16(SCALE_FLOAT(a, 15)) +#define FIX15(a) av_clip(SCALE_FLOAT(a, 15), -32767, 32767) /** |