1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

avcodec/smacker: Check input before allocation

Fixes: Timeout
Fixes: 421650030/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SMACKAUD_fuzzer-6144441767493632

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
2025-07-03 03:03:04 +02:00
parent 9899c8c00b
commit af3852e22c

View File

@ -662,6 +662,10 @@ static int smka_decode_frame(AVCodecContext *avctx, AVFrame *frame,
} else } else
values[i] = h.entries[0].value; values[i] = h.entries[0].value;
} }
if (get_bits_left(&gb) < (stereo+1) * (bits+1) * 8) {
ret = AVERROR_INVALIDDATA;
goto error;
}
if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
return ret; return ret;