Commit 6c91afe4 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/snowdec: Fix avmv_index increment

Fixes reading uninitialized memory
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 627d2a76
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment