diff mbox series

[FFmpeg-devel,5/5] avformat/cinedec: Fix index_entries size check

Message ID 20210131215605.28190-5-michael@niedermayer.cc
State Accepted
Commit 09b304035423409ce18d731995fa3b921d54f9b5
Headers show
Series [FFmpeg-devel,1/5] avformat/sbgdec: Use av_sat_add64() in str_to_time()
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Michael Niedermayer Jan. 31, 2021, 9:56 p.m. UTC
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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavformat/cinedec.c b/libavformat/cinedec.c
index c6c0d927ee..e5c6468c39 100644
--- a/libavformat/cinedec.c
+++ b/libavformat/cinedec.c
@@ -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);