[FFmpeg-cvslog] avformat/swfdec: clear 4 bytes at the end of a packet if they are not initialized

Michael Niedermayer git at videolan.org
Thu Dec 19 05:10:03 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Dec 19 04:38:16 2013 +0100| [f5d039840aca64d0ce79cd08e64423833becf570] | committer: Michael Niedermayer

avformat/swfdec: clear 4 bytes at the end of a packet if they are not initialized

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 at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f5d039840aca64d0ce79cd08e64423833becf570
---

 libavformat/swfdec.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/swfdec.c b/libavformat/swfdec.c
index c36c024..c95b18e 100644
--- a/libavformat/swfdec.c
+++ b/libavformat/swfdec.c
@@ -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);



More information about the ffmpeg-cvslog mailing list