OSDN Git Service

avformat/swfdec: clear 4 bytes at the end of a packet if they are not initialized
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 19 Dec 2013 03:38:16 +0000 (04:38 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 19 Dec 2013 04:07:22 +0000 (05:07 +0100)
Fixes use of uninitialized memory
Fixes part of msan_uninit-mem_7f055dd0ab1b_9558_videopop_guitar_300k.swf
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/swfdec.c

index c36c024..c95b18e 100644 (file)
@@ -455,6 +455,7 @@ bitmap_end_skip:
                 /* old SWF files containing SOI/EOI as data start */
                 /* files created by swink have reversed tag */
                 pkt->size -= 4;
+                memset(pkt->data+pkt->size, 0, 4);
                 res = avio_read(pb, pkt->data, pkt->size);
             } else {
                 res = avio_read(pb, pkt->data + 4, pkt->size - 4);