Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-12-15 04:32:48 +0400
committerMichael Niedermayer <michaelni@gmx.at>2013-12-15 04:44:04 +0400
commit6f9be9106382083b2268ddb3599fbf49abb36f6b (patch)
tree236395e426defa92c9fd5be287db5e918326faa8 /libavformat/iff.c
parent2b31a9c613f95383d5106f8c1cbcee8eb291090f (diff)
avformat/iff: fix memleak of packet
Fixes: msan_uninit-mem_7f65b9788da6_388_24.iff Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/iff.c')
-rw-r--r--libavformat/iff.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/iff.c b/libavformat/iff.c
index 03c4b08762..b5751c5664 100644
--- a/libavformat/iff.c
+++ b/libavformat/iff.c
@@ -462,7 +462,9 @@ static int iff_read_packet(AVFormatContext *s,
buf = pkt->data;
bytestream_put_be16(&buf, 2);
ret = avio_read(pb, buf, iff->body_size);
- if (ret>=0 && ret < iff->body_size)
+ if (ret<0) {
+ av_free_packet(pkt);
+ } else if (ret < iff->body_size)
av_shrink_packet(pkt, ret + 2);
} else {
av_assert0(0);