Commits

Anonymous committed 052f560

parser/common/deflate: ensure that the unconsumed tail is always fed to the decompressor

Comments (0)

Files changed (1)

hachoir-parser/hachoir_parser/common/deflate.py

 
         def __call__(self, size, data=None):
             if data is None:
-                data = self.gzip.unconsumed_tail
-            return self.gzip.decompress(data, size)
+                data = ''
+            return self.gzip.decompress(self.gzip.unconsumed_tail+data, size)
 
     class DeflateStreamWbits(DeflateStream):
         def __init__(self, stream):