[FFmpeg-cvslog] avcodec/iff: warn about truncated input to decode_byterun() and clear remaining output

Michael Niedermayer git at videolan.org
Fri Dec 20 01:33:33 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Dec 19 20:48:51 2013 +0100| [b3f44eafa5a8748f777d0935d6e5562a604d8770] | committer: Michael Niedermayer

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 at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b3f44eafa5a8748f777d0935d6e5562a604d8770
---

 libavcodec/iff.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/iff.c b/libavcodec/iff.c
index e71f5b0..4bde0a8 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;
 }
 



More information about the ffmpeg-cvslog mailing list