summaryrefslogtreecommitdiff
path: root/libavcodec/adxdec.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2011-11-20 14:03:21 -0500
committerJustin Ruggles <justin.ruggles@gmail.com>2011-11-26 16:25:06 -0500
commit954d94dd5e13ba7a5e9e049d0f980bddced9644c (patch)
tree87451e73dada8b00012e03e27c0e5c1aa6f8a53d /libavcodec/adxdec.c
parentc52ddc60241229af198ac03c8d86d219e7d5942a (diff)
downloadffmpeg-954d94dd5e13ba7a5e9e049d0f980bddced9644c.tar.gz
adx: use 12-bit coefficients instead of 14-bit to avoid integer overflow
Diffstat (limited to 'libavcodec/adxdec.c')
-rw-r--r--libavcodec/adxdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/adxdec.c b/libavcodec/adxdec.c
index 39223c2e4f..93bbc6b51b 100644
--- a/libavcodec/adxdec.c
+++ b/libavcodec/adxdec.c
@@ -59,7 +59,7 @@ static void adx_decode(ADXContext *c, int16_t *out, const uint8_t *in, int ch)
s2 = prev->s2;
for (i = 0; i < 32; i++) {
d = get_sbits(&gb, 4);
- s0 = (BASEVOL * d * scale + SCALE1 * s1 - SCALE2 * s2) >> 14;
+ s0 = ((d << COEFF_BITS) * scale + COEFF1 * s1 - COEFF2 * s2) >> COEFF_BITS;
s2 = s1;
s1 = av_clip_int16(s0);
*out = s1;