diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2024-09-22 22:56:48 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2024-09-24 15:37:19 +0200 |
commit | 5f471b500c4f9f37a902266616644dd1496b022b (patch) | |
tree | bc94d69a804a20f37871433c09599b26cebde73c | |
parent | 8367d7e184562f8b9f410c0f325596f7e041884f (diff) | |
download | ffmpeg-5f471b500c4f9f37a902266616644dd1496b022b.tar.gz |
avcodec/sgirledec: Check input length
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@niedermayer.cc>
-rw-r--r-- | libavcodec/sgirledec.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/sgirledec.c b/libavcodec/sgirledec.c index 3ce72eccb8..3bd31b7347 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; |