mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
avcodec/lagarith: Sanity check scale
A value of 24 and above can collaps the range to 0 which would not work.
Fixes: Timeout (75sec -> 21sec)
Fixes: 18707/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LAGARITH_fuzzer-5708950892969984
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 fb3855342b
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
d75d754b84
commit
c4dccb509d
@ -226,6 +226,9 @@ static int lag_read_prob_header(lag_rac *rac, GetBitContext *gb)
|
||||
}
|
||||
}
|
||||
|
||||
if (scale_factor > 23)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
rac->scale = scale_factor;
|
||||
|
||||
/* Fill probability array with cumulative probability for each symbol. */
|
||||
|
Loading…
Reference in New Issue
Block a user