1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

avcodec/snowdec: Fix avmv_index increment

Fixes reading uninitialized memory

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2015-02-20 03:19:02 +01:00
parent 627d2a7628
commit 6c91afe497

View 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;