aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-07-22 02:57:12 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-07-26 00:14:22 +0200
commita0edd7f583b8f63340a3c46c04d44f2ed5e0d4e7 (patch)
tree1856f36851fc297de0ae7070e2ad340d0fbc3196
parent2755c73d55b2c92e73698aa03c580f311dc36d6f (diff)
downloadffmpeg-a0edd7f583b8f63340a3c46c04d44f2ed5e0d4e7.tar.gz
avcodec/ylc: Fix shift overflow
Fixes: runtime error: shift exponent 32 is too large for 32-bit type 'unsigned int' Fixes: 2698/clusterfuzz-testcase-minimized-4713541443518464 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 03a9e6ff303ad82e75b734edbe4917ca5fd60159) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/ylc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/ylc.c b/libavcodec/ylc.c
index c2263e729a..346960a6cc 100644
--- a/libavcodec/ylc.c
+++ b/libavcodec/ylc.c
@@ -68,7 +68,7 @@ static void get_tree_codes(uint32_t *bits, int16_t *lens, uint8_t *xlat,
s = nodes[node].sym;
if (s != -1) {
- bits[*pos] = (~pfx) & ((1U << FFMAX(pl, 1)) - 1);
+ bits[*pos] = (~pfx) & ((1ULL << FFMAX(pl, 1)) - 1);
lens[*pos] = FFMAX(pl, 1);
xlat[*pos] = s + (pl == 0);
(*pos)++;