From 8aea2f05dc56f7e7d60767dd27ba8e846a05e8ae Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Wed, 12 Jun 2013 16:16:59 +0200 Subject: [PATCH] alacenc: Fix missing sign_extend() Possibly fixes Ticket2497 Signed-off-by: Michael Niedermayer --- libavcodec/alacenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/alacenc.c b/libavcodec/alacenc.c index c41ad1a66d..42068926d0 100644 --- a/libavcodec/alacenc.c +++ b/libavcodec/alacenc.c @@ -274,7 +274,7 @@ static void alac_linear_predictor(AlacEncodeContext *s, int ch) // generate warm-up samples residual[0] = samples[0]; for (i = 1; i <= lpc.lpc_order; i++) - residual[i] = samples[i] - samples[i-1]; + residual[i] = sign_extend(samples[i] - samples[i-1], s->write_sample_size); // perform lpc on remaining samples for (i = lpc.lpc_order + 1; i < s->frame_size; i++) {