summaryrefslogtreecommitdiff
path: root/libavformat/4xm.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-12-21 12:52:23 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-12-22 01:48:33 +0100
commit9b195dd5793edb88a72d53cb080c2216e91a5849 (patch)
tree3d330c0f10fad25ed406ab0822e4fb56bc9733c8 /libavformat/4xm.c
parent2c635fabbf7ec8ed4f30d9b3c04d5c24cb7a081d (diff)
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@gmx.at>
Diffstat (limited to 'libavformat/4xm.c')
-rw-r--r--libavformat/4xm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/4xm.c b/libavformat/4xm.c
index 6e63c67399..23279c42fb 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: