aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-08-25 01:15:30 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-08-28 01:43:28 +0200
commit9a73a776816b359cc5befe2ddaa7edef22c4f353 (patch)
treef41c7b3bca113ebb343cf28204e7560c35c8b187
parent4c6bed6e3be18f09223e952213b9cb1098ff956f (diff)
downloadffmpeg-9a73a776816b359cc5befe2ddaa7edef22c4f353.tar.gz
avformat/mvdec: Fix DoS due to lack of eof check
Fixes: loop.mv Found-by: Xiaohei and Wangchu from Alibaba Security Team Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 4f05e2e2dc1a89f38cd9f0960a6561083d714f1e) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/mvdec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/mvdec.c b/libavformat/mvdec.c
index 7aa6452f66..e3feda6687 100644
--- a/libavformat/mvdec.c
+++ b/libavformat/mvdec.c
@@ -338,6 +338,8 @@ static int mv_read_header(AVFormatContext *avctx)
uint32_t pos = avio_rb32(pb);
uint32_t asize = avio_rb32(pb);
uint32_t vsize = avio_rb32(pb);
+ if (avio_feof(pb))
+ return AVERROR_INVALIDDATA;
avio_skip(pb, 8);
av_add_index_entry(ast, pos, timestamp, asize, 0, AVINDEX_KEYFRAME);
av_add_index_entry(vst, pos + asize, i, vsize, 0, AVINDEX_KEYFRAME);