[FFmpeg-devel] [PATCH 07/10] avcodec/sgirl edec: Check input length
Michael Niedermayer
michael at niedermayer.cc
Mon Sep 23 00:56:42 EEST 2024
Fixes: Timeout
Fixes: 71712/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SGIRLE_fuzzer-5763700835811328
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
libavcodec/sgirledec.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libavcodec/sgirledec.c b/libavcodec/sgirledec.c
index 3ce72eccb86..3bd31b73470 100644
--- a/libavcodec/sgirledec.c
+++ b/libavcodec/sgirledec.c
@@ -115,6 +115,9 @@ static int sgirle_decode_frame(AVCodecContext *avctx, AVFrame *frame,
{
int ret;
+ if (avpkt->size * 192ll / 2 < avctx->width * avctx->height)
+ return AVERROR_INVALIDDATA;
+
if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
return ret;
--
2.46.1
More information about the ffmpeg-devel
mailing list