Commit fde74d1b authored by Michael Niedermayer's avatar Michael Niedermayer

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: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 8eb76217
......@@ -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 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment