diff --git a/inflate.c b/inflate.c index 4feac091..474e3712 100644 --- a/inflate.c +++ b/inflate.c @@ -232,7 +232,7 @@ int ZEXPORT inflatePrime(z_streamp strm, int bits, int value) { state->bits = 0; return Z_OK; } - if (bits > 16 || state->bits + (uInt)bits > 32) return Z_STREAM_ERROR; + if (bits > 16 || state->bits + (uInt)bits >= 32) return Z_STREAM_ERROR; value &= (1L << bits) - 1; state->hold += (unsigned)value << state->bits; state->bits += (uInt)bits;