1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avcodec/pixlet: Fix log(0) check

Fixes: passing zero to clz(), which is not a valid argument
Fixes: 23337/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PIXLET_fuzzer-5179131989065728

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 bd0f81526d)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2020-06-13 11:21:52 +02:00
parent 91f56dc647
commit 2f25de29cf

View File

@ -217,7 +217,7 @@ static int read_high_coeffs(AVCodecContext *avctx, uint8_t *src, int16_t *dst, i
length = 25 - nbits;
while (i < size) {
if (state >> 8 != -3) {
if (((state >> 8) + 3) & 0xFFFFFFF) {
value = ff_clz((state >> 8) + 3) ^ 0x1F;
} else {
value = -1;