Skip to content

Commit 0277458

Browse files
committed
Only remove unconsumed tail when existing
1 parent 7b87875 commit 0277458

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/isal/isal_zlib.pyx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,8 @@ cdef class Decompress:
566566
# we assume the bitbuffer data is already added.
567567
self.unused_data = self._view_bitbuffer()
568568
self.unused_data += new_data
569-
self.unconsumed_tail = b"" # When there is unused_data unconsumed tail should be b""
569+
if self.unconsumed_tail:
570+
self.unconsumed_tail = b"" # When there is unused_data unconsumed tail should be b""
570571
elif self.stream.avail_in > 0 or self.unconsumed_tail:
571572
left_size = <unsigned char*>data.buf + data.len - self.stream.next_in
572573
new_data = PyBytes_FromStringAndSize(<char *>self.stream.next_in, left_size)

0 commit comments

Comments
 (0)