ac3dec: fix outptr increment.
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 25 Oct 2013 22:46:53 +0000 (18:46 -0400)
committerJustin Ruggles <justin.ruggles@gmail.com>
Mon, 28 Oct 2013 12:33:21 +0000 (08:33 -0400)
Fixes corrupt data errors when downmixing in the AC-3 decoder.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
CC:libav-stable@libav.org

libavcodec/ac3dec.c

index d664325..3edb3af 100644 (file)
@@ -1400,7 +1400,7 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data,
                 memcpy(s->outptr[channel_map[ch]], output[ch], sizeof(**output) * AC3_BLOCK_SIZE);
         for (ch = 0; ch < s->out_channels; ch++)
             output[ch] = s->outptr[channel_map[ch]];
-        for (ch = 0; ch < s->channels; ch++)
+        for (ch = 0; ch < s->out_channels; ch++)
             s->outptr[ch] += AC3_BLOCK_SIZE;
     }