mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
avcodec/escape124: Check depth against num_superblocks
Fixes: runtime error: left shift of 66184 by 15 places cannot be represented in type 'int' Fixes: 1707/clusterfuzz-testcase-minimized-6502767008940032 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:
parent
ef01061225
commit
da617408c8
@ -267,6 +267,11 @@ static int escape124_decode_frame(AVCodecContext *avctx,
|
|||||||
cb_size = s->num_superblocks << cb_depth;
|
cb_size = s->num_superblocks << cb_depth;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (s->num_superblocks >= INT_MAX >> cb_depth) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "Depth or num_superblocks are too large\n");
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
|
|
||||||
av_freep(&s->codebooks[i].blocks);
|
av_freep(&s->codebooks[i].blocks);
|
||||||
s->codebooks[i] = unpack_codebook(&gb, cb_depth, cb_size);
|
s->codebooks[i] = unpack_codebook(&gb, cb_depth, cb_size);
|
||||||
if (!s->codebooks[i].blocks)
|
if (!s->codebooks[i].blocks)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user