avcodec/dcadec: Only upsample as much data as is there
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 15 Mar 2015 23:44:54 +0000 (00:44 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 15 Mar 2015 23:44:54 +0000 (00:44 +0100)
Found-by: carl
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/dcadec.c

index f8fa310..1ba9863 100644 (file)
@@ -1038,7 +1038,7 @@ static int dca_filter_channels(DCAContext *s, int block_index, int upsample)
             unsigned i;
             /* Should apply the filter in Table 6-11 when upsampling. For
              * now, just duplicate. */
-            for (i = 511; i > 0; i--) {
+            for (i = 255; i > 0; i--) {
                 samples[2 * i]     =
                 samples[2 * i + 1] = samples[i];
             }