[FFmpeg-cvslog] avformat/iff: check avio_read() return in get_metadata()

Michael Niedermayer git at videolan.org
Sun Dec 29 01:05:54 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Dec 29 00:57:15 2013 +0100| [8e90c7285d1cbf62a9c9a5f9e6efda998dc0d454] | committer: Michael Niedermayer

avformat/iff: check avio_read() return in get_metadata()

Fixes: msan_uninit-mem_7f9539ba8461_4760_dasboot_in_compressed
Fixes use of uninitialized memory
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=8e90c7285d1cbf62a9c9a5f9e6efda998dc0d454
---

 libavformat/iff.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/iff.c b/libavformat/iff.c
index b5751c5..3838db1 100644
--- a/libavformat/iff.c
+++ b/libavformat/iff.c
@@ -118,7 +118,7 @@ static int get_metadata(AVFormatContext *s,
     if (!buf)
         return AVERROR(ENOMEM);
 
-    if (avio_read(s->pb, buf, data_size) < 0) {
+    if (avio_read(s->pb, buf, data_size) != data_size) {
         av_free(buf);
         return AVERROR(EIO);
     }



More information about the ffmpeg-cvslog mailing list