1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

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>
This commit is contained in:
Michael Niedermayer 2024-09-22 22:56:48 +02:00
parent 8367d7e184
commit 5f471b500c
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64

View File

@ -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;