diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-12-14 03:58:18 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-12-14 03:59:43 +0400 |
commit | cf95dee3de5930172900ef36e376c8a7f31988bc (patch) | |
tree | f782a3bdf5c670f17ab5be62c374d089f64ce018 /libavcodec/vc1dec.c | |
parent | f5cf0ea93a55f43b553aa7d6698936e48c6a94df (diff) |
avcodec/vc1dec: dont calculate unused values from uninitialized sprites
Fixes use of uninitialized data
Fixes part of msan_uninit-mem_7f51a8b0b3b0_1009_Arlington.wmv
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/vc1dec.c')
-rw-r--r-- | libavcodec/vc1dec.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index 87846449ec..edddc483a2 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -5364,7 +5364,7 @@ static void vc1_draw_sprites(VC1Context *v, SpriteData* sd) int ysub[2]; MpegEncContext *s = &v->s; - for (i = 0; i < 2; i++) { + for (i = 0; i <= v->two_sprites; i++) { xoff[i] = av_clip(sd->coefs[i][2], 0, v->sprite_width-1 << 16); xadv[i] = sd->coefs[i][0]; if (xadv[i] != 1<<16 || (v->sprite_width << 16) - (v->output_width << 16) - xoff[i]) @@ -5442,7 +5442,7 @@ static void vc1_draw_sprites(VC1Context *v, SpriteData* sd) } if (!plane) { - for (i = 0; i < 2; i++) { + for (i = 0; i <= v->two_sprites; i++) { xoff[i] >>= 1; yoff[i] >>= 1; } |