mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-19 05:49:09 +02:00
avcodec/jpegls: Check A[Q] for overflow in ff_jpegls_update_state_regular()
Fixes: Timeout Fixes: 30912/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MJPEG_fuzzer-5556235476795392 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 8a3fea802a3e4274dbe084d372ec8aeab3932b3e) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
f3a82afec9
commit
1fe0b12adc
@ -97,7 +97,7 @@ static inline void ff_jpegls_downscale_state(JLSState *state, int Q)
|
|||||||
static inline int ff_jpegls_update_state_regular(JLSState *state,
|
static inline int ff_jpegls_update_state_regular(JLSState *state,
|
||||||
int Q, int err)
|
int Q, int err)
|
||||||
{
|
{
|
||||||
if(FFABS(err) > 0xFFFF)
|
if(FFABS(err) > 0xFFFF || FFABS(err) > INT_MAX - state->A[Q])
|
||||||
return -0x10000;
|
return -0x10000;
|
||||||
state->A[Q] += FFABS(err);
|
state->A[Q] += FFABS(err);
|
||||||
err *= state->twonear;
|
err *= state->twonear;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user