X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fcinedec.c;h=de34fb963820188a8c9965263978cb4a408d33d9;hb=d96363cc8437c9de8fd747068ab331510149810c;hp=763b93ba2e178956bef1984ad06b011758699089;hpb=a8ad127a63ab6348050bfade358facae68f39a2a;p=ffmpeg diff --git a/libavformat/cinedec.c b/libavformat/cinedec.c index 763b93ba2e1..de34fb96382 100644 --- a/libavformat/cinedec.c +++ b/libavformat/cinedec.c @@ -267,8 +267,12 @@ static int cine_read_header(AVFormatContext *avctx) /* parse image offsets */ avio_seek(pb, offImageOffsets, SEEK_SET); - for (i = 0; i < st->duration; i++) + for (i = 0; i < st->duration; i++) { + if (avio_feof(pb)) + return AVERROR_INVALIDDATA; + av_add_index_entry(st, avio_rl64(pb), i, 0, 0, AVINDEX_KEYFRAME); + } return 0; }