ac3dec: split out pointer update loop for saftey
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
4e0738cec9
commit
b888cea9cb
@ -1400,8 +1400,9 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data,
|
|||||||
if (err)
|
if (err)
|
||||||
for (ch = 0; ch < s->out_channels; ch++)
|
for (ch = 0; ch < s->out_channels; ch++)
|
||||||
memcpy(((float*)s->frame.data[ch]) + AC3_BLOCK_SIZE*blk, output[ch], 1024);
|
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]];
|
output[ch] = s->outptr[channel_map[ch]];
|
||||||
|
for (ch = 0; ch < s->out_channels; ch++) {
|
||||||
if (!ch || channel_map[ch])
|
if (!ch || channel_map[ch])
|
||||||
s->outptr[channel_map[ch]] += AC3_BLOCK_SIZE;
|
s->outptr[channel_map[ch]] += AC3_BLOCK_SIZE;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user