aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/alacenc.c
diff options
context:
space:
mode:
authorJai Menon <realityman@gmx.net>2008-12-05 07:58:31 +0000
committerBenoit Fouet <benoit.fouet@free.fr>2008-12-05 07:58:31 +0000
commit3d5e1bfb20d3489d7bb2fa26196e02086e06f2b8 (patch)
treed58d3999443554f5d7fc2c63bd78ac33bfdecd90 /libavcodec/alacenc.c
parent6e74619e5e60e362f9d010acdbca143f5b079fc3 (diff)
downloadffmpeg-3d5e1bfb20d3489d7bb2fa26196e02086e06f2b8.tar.gz
Fix an overflow in the predictor.
fixes issue 636 Patch by Jai. Originally committed as revision 16007 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/alacenc.c')
-rw-r--r--libavcodec/alacenc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/alacenc.c b/libavcodec/alacenc.c
index df4136f4c4..9fd5064514 100644
--- a/libavcodec/alacenc.c
+++ b/libavcodec/alacenc.c
@@ -253,7 +253,8 @@ static void alac_linear_predictor(AlacEncodeContext *s, int ch)
sum >>= lpc.lpc_quant;
sum += samples[0];
- residual[i] = samples[lpc.lpc_order+1] - sum;
+ residual[i] = (samples[lpc.lpc_order+1] - sum) << (32 - s->write_sample_size) >>
+ (32 - s->write_sample_size);
res_val = residual[i];
if(res_val) {