avcodec/ylc: Fix shift overflow master
authorMichael Niedermayer <michael@niedermayer.cc>
Sat, 22 Jul 2017 00:57:12 +0000 (02:57 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Mon, 24 Jul 2017 15:52:42 +0000 (17:52 +0200)
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>
libavcodec/ylc.c

index ae46b3b..1133322 100644 (file)
@@ -69,7 +69,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)++;