[FFmpeg-cvslog] ac3dec: split out pointer update loop for saftey

Michael Niedermayer git at videolan.org
Fri Jan 4 06:21:21 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Jan  4 06:09:43 2013 +0100| [b888cea9cb2a01276ce026a5abe90ad57e042444] | committer: Michael Niedermayer

ac3dec: split out pointer update loop for saftey

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b888cea9cb2a01276ce026a5abe90ad57e042444
---

 libavcodec/ac3dec.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c
index ea4a218..567c797 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;
         }



More information about the ffmpeg-cvslog mailing list