mirror of https://git.ffmpeg.org/ffmpeg.git
avcodec/proresdec: Consider negative bits left
Fixes: 70036/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PRORES_fuzzer-6298797647396864
Fixes: shift exponent 40 is too large for 32-bit type 'uint32_t' (aka 'unsigned int')
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 419eee6356
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
aa564c7cbd
commit
11834dcd8b
|
@ -488,7 +488,7 @@ static av_always_inline int decode_ac_coeffs(AVCodecContext *avctx, GetBitContex
|
||||||
|
|
||||||
for (pos = block_mask;;) {
|
for (pos = block_mask;;) {
|
||||||
bits_left = gb->size_in_bits - re_index;
|
bits_left = gb->size_in_bits - re_index;
|
||||||
if (!bits_left || (bits_left < 32 && !SHOW_UBITS(re, gb, bits_left)))
|
if (bits_left <= 0 || (bits_left < 32 && !SHOW_UBITS(re, gb, bits_left)))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
DECODE_CODEWORD(run, run_to_cb[FFMIN(run, 15)], LAST_SKIP_BITS);
|
DECODE_CODEWORD(run, run_to_cb[FFMIN(run, 15)], LAST_SKIP_BITS);
|
||||||
|
|
Loading…
Reference in New Issue