diff options
author | Michael Niedermayer <[email protected]> | 2014-01-10 02:11:20 +0100 |
---|---|---|
committer | Michael Niedermayer <[email protected]> | 2014-01-13 16:09:15 +0100 |
commit | 4f3b0afaa236f4c1cf0cce4b3b014af647b4e4a6 (patch) | |
tree | 6b9bec18f18fca414448658792258043118c59c5 | |
parent | 050d8d727ad68925f1ce2ce7779432d07ee1adce (diff) |
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 <[email protected]>
(cherry picked from commit 4162ceea93684f3cd656dc21d30903e102a44e73)
Signed-off-by: Michael Niedermayer <[email protected]>
-rw-r--r-- | libavformat/mxfdec.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index 3d87e963dd..e6352de1cc 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -484,7 +484,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 */ |