diff --git a/libavcodec/golomb.h b/libavcodec/golomb.h index 9e32991078..defee7139b 100644 --- a/libavcodec/golomb.h +++ b/libavcodec/golomb.h @@ -404,6 +404,7 @@ static inline int get_ur_golomb(GetBitContext *gb, int k, int limit, log = av_log2(buf); if (log > 31 - limit) { + av_assert2(log >= k); buf >>= log - k; buf += (30U - log) << k; LAST_SKIP_BITS(re, gb, 32 + k - log);