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: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-12-29 00:57:15 +01:00
parent 55fa898969
commit 8e90c7285d

View File

@ -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);
}