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>
pull/51/merge
Michael Niedermayer 11 years ago
parent 55fa898969
commit 8e90c7285d
  1. 2
      libavformat/iff.c

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

Loading…
Cancel
Save