diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-06-13 11:21:52 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-07-02 19:55:10 +0200 |
commit | 2f25de29cf4dcde2a03973542effcc16f55c0071 (patch) | |
tree | 0f6ee2443490ce3dccfd65783e9d233f34ffa8e5 | |
parent | 91f56dc64738c17d694b817a6f08db3966766446 (diff) | |
download | ffmpeg-2f25de29cf4dcde2a03973542effcc16f55c0071.tar.gz |
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 bd0f81526d3f4c23ecd0a399829103be2445c011)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/pixlet.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/pixlet.c b/libavcodec/pixlet.c index a9cfe085c9..aa7ef55b7d 100644 --- a/libavcodec/pixlet.c +++ b/libavcodec/pixlet.c @@ -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; |