diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-12-19 04:48:15 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-12-19 04:49:07 +0400 |
commit | fde74d1b9d338e2f9c9d7eac2023388d59c98543 (patch) | |
tree | 96d11198d977cde36131a4fb3c9c14b791f92129 /libavformat/swfdec.c | |
parent | 8eb76217d0137b7adad438f6c923310fbc1fc4c1 (diff) |
avformat/swfdec: check avio_read() return code
Fixes use of uninitialized memory
Fixes msan_uninit-mem_7f90d9cce964_9558_videopop_guitar_300k.swf
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/swfdec.c')
-rw-r--r-- | libavformat/swfdec.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/swfdec.c b/libavformat/swfdec.c index e6ceec818a..c77e28f0c9 100644 --- a/libavformat/swfdec.c +++ b/libavformat/swfdec.c @@ -446,7 +446,10 @@ bitmap_end_skip: goto skip; if ((res = av_new_packet(pkt, len)) < 0) return res; - avio_read(pb, pkt->data, 4); + if (avio_read(pb, pkt->data, 4) != 4) { + av_free_packet(pkt); + return AVERROR_INVALIDDATA; + } if (AV_RB32(pkt->data) == 0xffd8ffd9 || AV_RB32(pkt->data) == 0xffd9ffd8) { /* old SWF files containing SOI/EOI as data start */ |