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) {