OSDN Git Service

avformat/4xm: shrink packet if it was only partially initialized
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 21 Dec 2013 11:52:23 +0000 (12:52 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 22 Dec 2013 00:48:33 +0000 (01:48 +0100)
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@gmx.at>
libavformat/4xm.c

index 6e63c67..23279c4 100644 (file)
@@ -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: