File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -544,14 +544,16 @@ cdef class Decompress:
544
544
""" Shows the 64-bitbuffer of the internal inflate_state. It contains
545
545
a maximum of 8 bytes. This data is already read-in so is not part
546
546
of the unconsumed tail."""
547
- read_in_length = self .stream.read_in_length // 8
547
+ bits_in_buffer = self .stream.read_in_length
548
+ read_in_length = bits_in_buffer // 8
548
549
if read_in_length == 0 :
549
550
return b" "
551
+ remainder = bits_in_buffer % 8
550
552
read_in = self .stream.read_in
551
553
# The bytes are added by bitshifting, so in reverse order. Reading the
552
554
# 64-bit integer into 8 bytes little-endian provides the characters in
553
555
# the correct order.
554
- return read_in.to_bytes(8 , " little" )[:read_in_length]
556
+ return ( read_in >> remainder) .to_bytes(8 , " little" )[:read_in_length]
555
557
556
558
cdef save_unconsumed_input(self , Py_buffer * data):
557
559
cdef Py_ssize_t old_size, new_size, left_size
You can’t perform that action at this time.
0 commit comments