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>
This commit is contained in:
Michael Niedermayer 2013-12-21 12:52:23 +01:00
parent 2c635fabbf
commit 9b195dd579
1 changed files with 3 additions and 1 deletions

View 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: