Mercurial > libavcodec.hg
comparison alacenc.c @ 8261:5f48c58bfd51 libavcodec
Fix an overflow in the predictor.
fixes issue 636
Patch by Jai.
author | benoit |
---|---|
date | Fri, 05 Dec 2008 07:58:31 +0000 |
parents | 4525dcd81357 |
children | ac31a0265eb9 |
comparison
equal
deleted
inserted
replaced
8260:8aa88616d6d8 | 8261:5f48c58bfd51 |
---|---|
251 lpc.lpc_coeff[j]; | 251 lpc.lpc_coeff[j]; |
252 } | 252 } |
253 | 253 |
254 sum >>= lpc.lpc_quant; | 254 sum >>= lpc.lpc_quant; |
255 sum += samples[0]; | 255 sum += samples[0]; |
256 residual[i] = samples[lpc.lpc_order+1] - sum; | 256 residual[i] = (samples[lpc.lpc_order+1] - sum) << (32 - s->write_sample_size) >> |
257 (32 - s->write_sample_size); | |
257 res_val = residual[i]; | 258 res_val = residual[i]; |
258 | 259 |
259 if(res_val) { | 260 if(res_val) { |
260 int index = lpc.lpc_order - 1; | 261 int index = lpc.lpc_order - 1; |
261 int neg = (res_val < 0); | 262 int neg = (res_val < 0); |