You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-07-11 14:30:22 +02:00
avcodec/apedec: Check remaining space in decode_array_0000()
Fixes: Timeout (? -> 2sec) Fixes: 17886/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5728165124636672 Fixes: 18131/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5710803432374272 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:
@ -609,6 +609,10 @@ static void decode_array_0000(APEContext *ctx, GetBitContext *gb,
|
|||||||
ksummax = 1 << rice->k + 7;
|
ksummax = 1 << rice->k + 7;
|
||||||
ksummin = rice->k ? (1 << rice->k + 6) : 0;
|
ksummin = rice->k ? (1 << rice->k + 6) : 0;
|
||||||
for (; i < blockstodecode; i++) {
|
for (; i < blockstodecode; i++) {
|
||||||
|
if (get_bits_left(&ctx->gb) < 1) {
|
||||||
|
ctx->error = 1;
|
||||||
|
return ;
|
||||||
|
}
|
||||||
out[i] = get_rice_ook(&ctx->gb, rice->k);
|
out[i] = get_rice_ook(&ctx->gb, rice->k);
|
||||||
rice->ksum += out[i] - out[i - 64];
|
rice->ksum += out[i] - out[i - 64];
|
||||||
while (rice->ksum < ksummin) {
|
while (rice->ksum < ksummin) {
|
||||||
|
Reference in New Issue
Block a user