[FFmpeg-cvslog] avcodec/4xm: Check for cfrm exhaustion

Michael Niedermayer git at videolan.org
Sun Apr 14 23:59:08 EEST 2024


ffmpeg | branch: release/3.4 | Michael Niedermayer <michael at niedermayer.cc> | Wed Nov  8 01:44:07 2023 +0100| [cbc25c8cc8c52efa64cda14bdf92506103959e55] | committer: Michael Niedermayer

avcodec/4xm: Check for cfrm exhaustion

Fixes: index -1 out of bounds for type 'CFrameBuffer [100]'
Fixes: 63877/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FOURXM_fuzzer-5854263397711872

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit bb0a684d93f793457f7bff3940a1398eb9e91703)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cbc25c8cc8c52efa64cda14bdf92506103959e55
---

 libavcodec/4xm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/4xm.c b/libavcodec/4xm.c
index 5321b103af..2ea7c00be3 100644
--- a/libavcodec/4xm.c
+++ b/libavcodec/4xm.c
@@ -884,6 +884,8 @@ static int decode_frame(AVCodecContext *avctx, void *data,
         }
 
         if (i >= CFRAME_BUFFER_COUNT) {
+            if (free_index < 0)
+                return AVERROR_INVALIDDATA;
             i             = free_index;
             f->cfrm[i].id = id;
         }



More information about the ffmpeg-cvslog mailing list