aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2023-11-08 01:44:07 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2023-11-10 00:14:02 +0100
commitbb0a684d93f793457f7bff3940a1398eb9e91703 (patch)
tree58b98742abaa9eea5dcd5da8057bd5cb815e0aa2 /libavcodec
parent19fcf4313148e86aa47d81a8d5d5e8d056f1f906 (diff)
downloadffmpeg-bb0a684d93f793457f7bff3940a1398eb9e91703.tar.gz
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@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/4xm.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/4xm.c b/libavcodec/4xm.c
index 158b37a38b..cfe65c178a 100644
--- a/libavcodec/4xm.c
+++ b/libavcodec/4xm.c
@@ -885,6 +885,8 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *picture,
}
if (i >= CFRAME_BUFFER_COUNT) {
+ if (free_index < 0)
+ return AVERROR_INVALIDDATA;
i = free_index;
f->cfrm[i].id = id;
}