diff --git a/libavformat/mvdec.c b/libavformat/mvdec.c index e2e6e66f1f..2b7058560d 100644 --- a/libavformat/mvdec.c +++ b/libavformat/mvdec.c @@ -267,6 +267,8 @@ static void read_index(AVIOContext *pb, AVStream *st) uint32_t pos = avio_rb32(pb); uint32_t size = avio_rb32(pb); avio_skip(pb, 8); + if (avio_feof(pb)) + return ; av_add_index_entry(st, pos, timestamp, size, 0, AVINDEX_KEYFRAME); if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) { timestamp += size / (st->codecpar->channels * 2LL);