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

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

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 8a048fe6
......@@ -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);
......
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