aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-05-05 13:02:22 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-05-14 17:56:21 +0200
commit9b33462dc4e4b7c094874298515ca61826e23309 (patch)
treea99afb894f31034cc5a0c15d9594a298ca8734dd
parentdd349b24ce242320dec45aded3b9a9542bf435f1 (diff)
downloadffmpeg-9b33462dc4e4b7c094874298515ca61826e23309.tar.gz
avcodec/pixlet: Fix shift exponent 4294967268 is too large for 32-bit type 'int'
Fixes: 1336/clusterfuzz-testcase-minimized-4761381930795008 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 1f5b6c7e1ee604b1525b3ab84ea6e8817fe66f36) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/pixlet.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/pixlet.c b/libavcodec/pixlet.c
index 3de802fea9..05262648ae 100644
--- a/libavcodec/pixlet.c
+++ b/libavcodec/pixlet.c
@@ -154,7 +154,7 @@ static int read_low_coeffs(AVCodecContext *avctx, int16_t *dst, int size, int wi
state = 120 * (escape + flag) + state - (120 * state >> 8);
flag = 0;
- if (state * 4 > 0xFF || i >= size)
+ if (state * 4ULL > 0xFF || i >= size)
continue;
nbits = ((state + 8) >> 5) + (state ? ff_clz(state) : 32) - 24;
@@ -260,7 +260,7 @@ static int read_high_coeffs(AVCodecContext *avctx, uint8_t *src, int16_t *dst, i
flag = 0;
- if (state * 4 > 0xFF || i >= size)
+ if (state * 4ULL > 0xFF || i >= size)
continue;
pfx = ((state + 8) >> 5) + (state ? ff_clz(state): 32) - 24;