[FFmpeg-cvslog] avformat/4xm: shrink packet if it was only partially initialized

Michael Niedermayer git at videolan.org
Sun Dec 22 01:57:04 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Dec 21 12:52:23 2013 +0100| [9b195dd5793edb88a72d53cb080c2216e91a5849] | committer: Michael Niedermayer

avformat/4xm: shrink packet if it was only partially initialized

Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f6c76ab7950_4920_dracula.4xm
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=9b195dd5793edb88a72d53cb080c2216e91a5849
---

 libavformat/4xm.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/4xm.c b/libavformat/4xm.c
index 6e63c67..23279c4 100644
--- a/libavformat/4xm.c
+++ b/libavformat/4xm.c
@@ -319,8 +319,10 @@ static int fourxm_read_packet(AVFormatContext *s,
 
             if (ret < 0) {
                 av_free_packet(pkt);
-            } else
+            } else {
                 packet_read = 1;
+                av_shrink_packet(pkt, ret + 8);
+            }
             break;
 
         case snd__TAG:



More information about the ffmpeg-cvslog mailing list