diff --git a/libavformat/mvdec.c b/libavformat/mvdec.c index 186b581f89..609095286d 100644 --- a/libavformat/mvdec.c +++ b/libavformat/mvdec.c @@ -327,6 +327,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);