alacenc: Fix missing sign_extend()
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 12 Jun 2013 14:16:59 +0000 (16:16 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 12 Jun 2013 14:23:49 +0000 (16:23 +0200)
Possibly fixes Ticket2497

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/alacenc.c

index c41ad1a..4206892 100644 (file)
@@ -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++) {