From 8c013a9e55d9065793ef7ca6459d1178927a2b35 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Thu, 5 Mar 2015 19:31:56 +0100 Subject: [PATCH] avformat/avidec: Check avio_read() return before using the results for meta-data Signed-off-by: Michael Niedermayer --- libavformat/avidec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavformat/avidec.c b/libavformat/avidec.c index 8a0938d5dc..5c9443a4f4 100644 --- a/libavformat/avidec.c +++ b/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);