Skip to content

Commit f909a6a

Browse files
committed
Use correct max length default
1 parent 46aae40 commit f909a6a

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/isal/isal_zlib.pyx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -433,11 +433,8 @@ cdef class Decompress:
433433
def decompress(self, data, Py_ssize_t max_length = 0):
434434

435435
cdef Py_ssize_t total_bytes = 0
436-
if max_length > UINT32_MAX:
437-
raise OverflowError("A maximum of 4 GB is allowed for the max "
438-
"length.")
439-
elif max_length == 0: # Zlib default
440-
max_length = UINT32_MAX
436+
if max_length == 0:
437+
max_length = PY_SSIZE_T_MAX
441438
elif max_length < 0:
442439
raise ValueError("max_length can not be smaller than 0")
443440

0 commit comments

Comments
 (0)