diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-12-19 20:48:51 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-12-19 21:22:43 +0100 |
commit | b3f44eafa5a8748f777d0935d6e5562a604d8770 (patch) | |
tree | fcc365f15c74973e029b414d17fc35c7ae3b7915 /libavcodec/iff.c | |
parent | 5eeeb4abf9705891f4dd1a4499588428319dec24 (diff) | |
download | ffmpeg-b3f44eafa5a8748f777d0935d6e5562a604d8770.tar.gz |
avcodec/iff: warn about truncated input to decode_byterun() and clear remaining output
Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7fe205e395ed_8988_test.iff
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/iff.c')
-rw-r--r-- | libavcodec/iff.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/iff.c b/libavcodec/iff.c index e71f5b00b9..4bde0a8117 100644 --- a/libavcodec/iff.c +++ b/libavcodec/iff.c @@ -499,6 +499,10 @@ static int decode_byterun(uint8_t *dst, int dst_size, } x += length; } + if (x < dst_size) { + av_log(NULL, AV_LOG_WARNING, "decode_byterun ended before plane size\n"); + memset(dst+x, 0, dst_size - x); + } return buf - buf_start; } |