avformat/avidec: Check avio_read() return before using the results for meta-data

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/122/head
Michael Niedermayer 10 years ago
parent 8a048fe6f8
commit 8c013a9e55
  1. 3
      libavformat/avidec.c

@ -308,7 +308,8 @@ static int avi_read_tag(AVFormatContext *s, AVStream *st, uint32_t tag,
value = av_malloc(size + 1);
if (!value)
return AVERROR(ENOMEM);
avio_read(pb, value, size);
if (avio_read(pb, value, size) != size)
return AVERROR_INVALIDDATA;
value[size] = 0;
AV_WL32(key, tag);

Loading…
Cancel
Save