diff --git a/libavcodec/get_bits.h b/libavcodec/get_bits.h index 964456ee5d..89df381fdb 100644 --- a/libavcodec/get_bits.h +++ b/libavcodec/get_bits.h @@ -379,7 +379,7 @@ static inline int init_get_bits(GetBitContext *s, const uint8_t *buffer, int buffer_size; int ret = 0; - if (bit_size > INT_MAX - 7 || bit_size < 0) { + if (bit_size >= INT_MAX - 7 || bit_size < 0) { buffer_size = bit_size = 0; buffer = NULL; ret = AVERROR_INVALIDDATA;