Skip to content

Commit 4f05e2e

Browse files
committed
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>
1 parent 96f24d1 commit 4f05e2e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Diff for: libavformat/mvdec.c

+2
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,8 @@ static int mv_read_header(AVFormatContext *avctx)
342342
uint32_t pos = avio_rb32(pb);
343343
uint32_t asize = avio_rb32(pb);
344344
uint32_t vsize = avio_rb32(pb);
345+
if (avio_feof(pb))
346+
return AVERROR_INVALIDDATA;
345347
avio_skip(pb, 8);
346348
av_add_index_entry(ast, pos, timestamp, asize, 0, AVINDEX_KEYFRAME);
347349
av_add_index_entry(vst, pos + asize, i, vsize, 0, AVINDEX_KEYFRAME);

0 commit comments

Comments
 (0)