[FFmpeg-cvslog] avformat/mxfdec: check avio_read(UID) result

Michael Niedermayer git at videolan.org
Fri Jan 10 02:21:06 CET 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Jan 10 02:11:20 2014 +0100| [4162ceea93684f3cd656dc21d30903e102a44e73] | committer: Michael Niedermayer

avformat/mxfdec: check avio_read(UID) result

Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7fc9ba2fd98e_82_02785736.mxf
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=4162ceea93684f3cd656dc21d30903e102a44e73
---

 libavformat/mxfdec.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 07740eb..c27c1fc 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -487,7 +487,10 @@ static int mxf_read_partition_pack(void *arg, AVIOContext *pb, int tag, int size
     partition->index_sid = avio_rb32(pb);
     avio_skip(pb, 8);
     partition->body_sid = avio_rb32(pb);
-    avio_read(pb, op, sizeof(UID));
+    if (avio_read(pb, op, sizeof(UID)) != sizeof(UID)) {
+        av_log(mxf->fc, AV_LOG_ERROR, "Failed reading UID\n");
+        return AVERROR_INVALIDDATA;
+    }
     nb_essence_containers = avio_rb32(pb);
 
     /* some files don'thave FooterPartition set in every partition */



More information about the ffmpeg-cvslog mailing list