diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-12-27 00:23:10 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-12-27 00:26:57 +0100 |
commit | 42b6805cc1989f759f19e9d253527311741cbd3a (patch) | |
tree | 6693dac2516f7e8aaa1e1c0b85fa78b4fcf6db84 | |
parent | 0875a9e4fc4cb622758a6b59d4cb07b64f29b8b2 (diff) | |
download | ffmpeg-42b6805cc1989f759f19e9d253527311741cbd3a.tar.gz |
avcodec/huffyuvdec: clear remainder of the array on end of input in decode_422_bitstream()
Fixes: msan_uninit-mem_7f909423efcd_9923_yuv_predmed.avi
Fixes use of uninitialized memory
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/huffyuvdec.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/huffyuvdec.c b/libavcodec/huffyuvdec.c index 3cfda9b767..cbb41facb8 100644 --- a/libavcodec/huffyuvdec.c +++ b/libavcodec/huffyuvdec.c @@ -406,6 +406,9 @@ static void decode_422_bitstream(HYuvContext *s, int count) READ_2PIX(s->temp[0][2 * i ], s->temp[1][i], 1); READ_2PIX(s->temp[0][2 * i + 1], s->temp[2][i], 2); } + for (; i < count; i++) + s->temp[0][2 * i ] = s->temp[1][i] = + s->temp[0][2 * i + 1] = s->temp[2][i] = 128; } else { for (i = 0; i < count; i++) { READ_2PIX(s->temp[0][2 * i ], s->temp[1][i], 1); |