mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-19 05:55:07 +00:00
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: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
b2361cfb94
commit
2b31a9c613
@ -462,6 +462,8 @@ 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)
|
||||
av_shrink_packet(pkt, ret + 2);
|
||||
} else {
|
||||
av_assert0(0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user