]> git.sesse.net Git - ffmpeg/commitdiff
avformat/cinedec: Fix index_entries size check
authorMichael Niedermayer <michael@niedermayer.cc>
Sun, 31 Jan 2021 21:42:54 +0000 (22:42 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Sat, 13 Mar 2021 20:02:31 +0000 (21:02 +0100)
Fixes: out of array access
Fixes: 29868/clusterfuzz-testcase-minimized-ffmpeg_dem_CINE_fuzzer-5692001957445632
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/cinedec.c

index c6c0d927ee955122f3735a151cda8850f38dd26c..e5c6468c39154787b343186f92fe0afb42ac0d7f 100644 (file)
@@ -288,7 +288,7 @@ static int cine_read_packet(AVFormatContext *avctx, AVPacket *pkt)
     AVIOContext *pb = avctx->pb;
     int n, size, ret;
 
-    if (cine->pts >= st->duration)
+    if (cine->pts >= st->internal->nb_index_entries)
         return AVERROR_EOF;
 
     avio_seek(pb, st->internal->index_entries[cine->pts].pos, SEEK_SET);