[FFmpeg-cvslog] avcodec/snowdec: Fix avmv_index increment

Michael Niedermayer git at videolan.org
Fri Feb 20 03:32:04 CET 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Feb 20 03:19:02 2015 +0100| [6c91afe4973f25f050c8b704b62a8367fc5e7a8c] | committer: Michael Niedermayer

avcodec/snowdec: Fix avmv_index increment

Fixes reading uninitialized memory

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

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

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

diff --git a/libavcodec/snowdec.c b/libavcodec/snowdec.c
index 58f9ed8..e37190d 100644
--- a/libavcodec/snowdec.c
+++ b/libavcodec/snowdec.c
@@ -90,7 +90,7 @@ static av_always_inline void predict_slice_buffered(SnowContext *s, slice_buffer
 
     if(s->avmv && mb_y < mb_h && plane_index == 0)
         for(mb_x=0; mb_x<mb_w; mb_x++){
-            AVMotionVector *avmv = s->avmv + (s->avmv_index++);
+            AVMotionVector *avmv = s->avmv + s->avmv_index;
             const int b_width = s->b_width  << s->block_max_depth;
             const int b_stride= b_width;
             BlockNode *bn= &s->block[mb_x + mb_y*b_stride];
@@ -98,6 +98,8 @@ static av_always_inline void predict_slice_buffered(SnowContext *s, slice_buffer
             if (bn->type)
                 continue;
 
+            s->avmv_index++;
+
             avmv->w = block_w;
             avmv->h = block_h;
             avmv->dst_x = block_w*mb_x - block_w/2;



More information about the ffmpeg-cvslog mailing list