OSDN Git Service

avformat/iff: check avio_read() return in get_metadata()
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 28 Dec 2013 23:57:15 +0000 (00:57 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 28 Dec 2013 23:58:13 +0000 (00:58 +0100)
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@gmx.at>
libavformat/iff.c

index b5751c5..3838db1 100644 (file)
@@ -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);
     }