avcodec/snowdec: Fix avmv_index increment
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 20 Feb 2015 02:19:02 +0000 (03:19 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 20 Feb 2015 02:31:14 +0000 (03:31 +0100)
Fixes reading uninitialized memory

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/snowdec.c

index 58f9ed8..e37190d 100644 (file)
@@ -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;