File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -671,9 +671,9 @@ cdef class Decompress:
671
671
cdef Py_ssize_t unused_bytes
672
672
673
673
try :
674
- while self .stream.block_state ! = ISAL_BLOCK_FINISH and ibuflen ! = 0 :
674
+ while True :
675
675
arrange_input_buffer(& self .stream, & ibuflen)
676
- while ( self .stream.block_state ! = ISAL_BLOCK_FINISH) :
676
+ while True :
677
677
self .stream.next_out = obuf # Reset output buffer.
678
678
self .stream.avail_out = obuflen
679
679
err = isal_inflate(& self .stream)
@@ -685,9 +685,15 @@ cdef class Decompress:
685
685
# Instead of output buffer resizing as the zlibmodule.c example
686
686
# the data is appended to a list.
687
687
# TODO: Improve this with the buffer protocol.
688
+ if self .stream.avail_out == obuflen:
689
+ break
688
690
bytes_written = obuflen - self .stream.avail_out
689
691
total_bytes += bytes_written
690
692
out.append(obuf[:bytes_written])
693
+ if self .stream.avail_out != 0 :
694
+ break
695
+ if self .stream.block_state == ISAL_BLOCK_FINISH or ibuflen == 0 :
696
+ break
691
697
self .save_unconsumed_input(buffer )
692
698
return b" " .join(out)
693
699
finally :
You can’t perform that action at this time.
0 commit comments