aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-02-20 03:19:02 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-02-20 03:31:14 +0100
commit6c91afe4973f25f050c8b704b62a8367fc5e7a8c (patch)
tree16a9ac0f18d71a0778b7014a2e903916cf907a22 /libavcodec
parent627d2a7628fe178ee29e9b01d13912f8a15f98c8 (diff)
downloadffmpeg-6c91afe4973f25f050c8b704b62a8367fc5e7a8c.tar.gz
avcodec/snowdec: Fix avmv_index increment
Fixes reading uninitialized memory Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/snowdec.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/snowdec.c b/libavcodec/snowdec.c
index 58f9ed894b..e37190d0f9 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;