summaryrefslogtreecommitdiff
path: root/libavcodec/ac3dec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-01-04 06:09:43 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-01-04 06:20:39 +0100
commitb888cea9cb2a01276ce026a5abe90ad57e042444 (patch)
tree9bc033fcf7bd9b1390d1c6e013a1f446c3269b79 /libavcodec/ac3dec.c
parent4e0738cec9df382ed1edee26effe0b40ea22a3cd (diff)
ac3dec: split out pointer update loop for saftey
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/ac3dec.c')
-rw-r--r--libavcodec/ac3dec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c
index ea4a21809f..567c797659 100644
--- a/libavcodec/ac3dec.c
+++ b/libavcodec/ac3dec.c
@@ -1400,8 +1400,9 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data,
if (err)
for (ch = 0; ch < s->out_channels; ch++)
memcpy(((float*)s->frame.data[ch]) + AC3_BLOCK_SIZE*blk, output[ch], 1024);
- for (ch = 0; ch < s->out_channels; ch++) {
+ for (ch = 0; ch < s->out_channels; ch++)
output[ch] = s->outptr[channel_map[ch]];
+ for (ch = 0; ch < s->out_channels; ch++) {
if (!ch || channel_map[ch])
s->outptr[channel_map[ch]] += AC3_BLOCK_SIZE;
}