diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-03-11 16:47:13 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-03-11 16:47:13 +0100 |
commit | 8617bc6ffaa80916bca42a2fa621ab29c82e9e0b (patch) | |
tree | 05b62463a3f23f7863d6f2d2c5f496a1ea7e5828 /libavcodec/golomb.h | |
parent | 8c7a0932abeeabd86688b2cb495daa61c7fc19be (diff) | |
download | ffmpeg-8617bc6ffaa80916bca42a2fa621ab29c82e9e0b.tar.gz |
avcodec/golomb: Fix undefined shifts in unsigned rice decoding code
Found-by: Clang -fsanitize=shift
Reported-by: Thierry Foucu <tfoucu@google.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/golomb.h')
-rw-r--r-- | libavcodec/golomb.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/golomb.h b/libavcodec/golomb.h index b9b29e7e66..28ae2133dc 100644 --- a/libavcodec/golomb.h +++ b/libavcodec/golomb.h @@ -281,7 +281,7 @@ static inline int get_ur_golomb(GetBitContext *gb, int k, int limit, if (log > 31 - limit) { buf >>= log - k; - buf += (30 - log) << k; + buf += (30U - log) << k; LAST_SKIP_BITS(re, gb, 32 + k - log); CLOSE_READER(re, gb); @@ -317,7 +317,7 @@ static inline int get_ur_golomb_jpegls(GetBitContext *gb, int k, int limit, if (log - k >= 32 - MIN_CACHE_BITS + (MIN_CACHE_BITS == 32) && 32 - log < limit) { buf >>= log - k; - buf += (30 - log) << k; + buf += (30U - log) << k; LAST_SKIP_BITS(re, gb, 32 + k - log); CLOSE_READER(re, gb); |