File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -556,17 +556,18 @@ cdef class Decompress:
556
556
cdef save_unconsumed_input(self , Py_buffer * data):
557
557
cdef Py_ssize_t old_size, new_size, left_size
558
558
cdef bytes new_data
559
- left_size = < unsigned char * > data.buf + data.len - self .stream.next_in
560
- new_data = PyBytes_FromStringAndSize(< char * > self .stream.next_in, left_size)
559
+ if self .stream.avail_in > 0 :
560
+ left_size = < unsigned char * > data.buf + data.len - self .stream.next_in
561
+ new_data = PyBytes_FromStringAndSize(< char * > self .stream.next_in, left_size)
562
+ else :
563
+ new_data = b" "
561
564
if self .stream.block_state == ISAL_BLOCK_FINISH:
562
565
self .eof = 1
563
- if self .stream.avail_in > 0 or self ._view_bitbuffer():
564
- # The block is finished and this decompressobject can not be
565
- # used anymore. Some unused data is in the bitbuffer and has to
566
- # be recovered.
567
- self .unused_data = self ._view_bitbuffer() + new_data
568
- if self .stream.avail_in > 0 :
569
- self .unconsumed_tail = new_data
566
+ # The block is finished and this decompressobject can not be
567
+ # used anymore. Some unused data is in the bitbuffer and has to
568
+ # be recovered.
569
+ self .unused_data = self ._view_bitbuffer() + new_data
570
+ self .unconsumed_tail = new_data
570
571
571
572
def decompress (self , data , Py_ssize_t max_length = 0 ):
572
573
"""
You can’t perform that action at this time.
0 commit comments