diff --git a/libavformat/mvdec.c b/libavformat/mvdec.c index 5fa43c1ac9..3b59f7ee14 100644 --- a/libavformat/mvdec.c +++ b/libavformat/mvdec.c @@ -258,6 +258,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->codec->codec_type == AVMEDIA_TYPE_AUDIO) { timestamp += size / (st->codec->channels * 2);