OSDN Git Service

avcodec/golomb: Fix runtime error: left shift of 1 by 31 places cannot be represented...
authorMichael Niedermayer <michael@niedermayer.cc>
Thu, 11 May 2017 19:42:45 +0000 (21:42 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Thu, 11 May 2017 21:55:49 +0000 (23:55 +0200)
Fixes: 1481/clusterfuzz-testcase-minimized-5264379509473280

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/golomb.h

index 6911759..0833aff 100644 (file)
@@ -352,7 +352,7 @@ static inline int get_ur_golomb_jpegls(GetBitContext *gb, int k, int limit,
                 buf = 0;
             }
 
-            buf += (i << k);
+            buf += ((SUINT)i << k);
         } else if (i == limit - 1) {
             buf = SHOW_UBITS(re, gb, esc_len);
             LAST_SKIP_BITS(re, gb, esc_len);