Skip to content

Commit 368a537

Browse files
committed
Fix decompress
1 parent 28bc0ad commit 368a537

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/isal/isal_zlib.pyx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ cdef class Decompress:
463463
try:
464464
# This loop reads all the input bytes. If there are no input bytes
465465
# anymore the output is written.
466-
while self.stream.block_state != ISAL_BLOCK_FINISH and ibuflen !=0 and not last_round:
466+
while True:
467467
arrange_input_buffer(&self.stream, &ibuflen)
468468
while (self.stream.avail_out == 0 or self.stream.avail_in != 0):
469469
self.stream.next_out = obuf # Reset output buffer.
@@ -488,6 +488,8 @@ cdef class Decompress:
488488
out.append(obuf[:bytes_written])
489489
if self.stream.block_state == ISAL_BLOCK_FINISH or last_round:
490490
break
491+
if self.stream.block_state == ISAL_BLOCK_FINISH or ibuflen ==0:
492+
break
491493
self.save_unconsumed_input(buffer)
492494
return b"".join(out)
493495
finally:

0 commit comments

Comments
 (0)