Skip to content

Commit add4b9d

Browse files
committed
fix infinite loop
1 parent 5cb08f2 commit add4b9d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/isal/isal_zlib.pyx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,10 @@ cpdef decompress(data,
223223
out.append(obuf[:obuflen - stream.avail_out])
224224
if stream.avail_in == 0:
225225
break
226+
227+
# When nothing was written, stop.
228+
if stream.avail_out == obuflen:
229+
break
226230
if stream.block_state != ISAL_BLOCK_FINISH:
227231
raise IsalError("incomplete or truncated stream")
228232
return b"".join(out)

0 commit comments

Comments
 (0)