Skip to content
Snippets Groups Projects
Commit 2b31a9c6 authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

avformat/iff: shrink packets to the initialized data


Fixes use of uninitialized data
Fixes: msan_uninit-mem_7f65b9788da6_388_24.iff
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: default avatarMichael Niedermayer <michaelni@gmx.at>
parent b2361cfb
No related branches found
No related tags found
No related merge requests found
...@@ -462,6 +462,8 @@ static int iff_read_packet(AVFormatContext *s, ...@@ -462,6 +462,8 @@ static int iff_read_packet(AVFormatContext *s,
buf = pkt->data; buf = pkt->data;
bytestream_put_be16(&buf, 2); bytestream_put_be16(&buf, 2);
ret = avio_read(pb, buf, iff->body_size); ret = avio_read(pb, buf, iff->body_size);
if (ret>=0 && ret < iff->body_size)
av_shrink_packet(pkt, ret + 2);
} else { } else {
av_assert0(0); av_assert0(0);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment