Commit 8e90c728 authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/iff: check avio_read() return in get_metadata()

Fixes: msan_uninit-mem_7f9539ba8461_4760_dasboot_in_compressed
Fixes use of uninitialized memory
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 55fa8989
......@@ -118,7 +118,7 @@ static int get_metadata(AVFormatContext *s,
if (!buf)
return AVERROR(ENOMEM);
if (avio_read(s->pb, buf, data_size) < 0) {
if (avio_read(s->pb, buf, data_size) != data_size) {
av_free(buf);
return AVERROR(EIO);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment