Skip to content

Commit

Permalink
Fix error decompressing some files larger than 128 kilobytes (#57).
Browse files Browse the repository at this point in the history
  • Loading branch information
fancycode committed Mar 24, 2019
1 parent dec3b88 commit 778ee2c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions py7zlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,11 @@ def _read_from_decompressor(self, coder, decompressor, input, level, num_coders,
input = self._file.read(total)
if is_last_coder and can_partial_decompress:
data = decompressor.decompress(input, self._start+size)
elif can_partial_decompress:
total_decompressed = sum(self._uncompressed[level:])
data = decompressor.decompress(input, self._start+total_decompressed)
if not is_last_coder:
return data
else:
data = decompressor.decompress(input)
if can_partial_decompress and not is_last_coder:
Expand Down

0 comments on commit 778ee2c

Please sign in to comment.