Skip to content

Commit 6d61a6d

Browse files
authored
Merge pull request #86 from onekey-sec/fix-lzo
Fix LZO decompression after switching to lzallright
2 parents 479646d + 82fb82c commit 6d61a6d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

ubireader/ubifs/misc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1818
#############################################################
1919

20-
from lzallright.lzallright import LZOCompressor as lzo
20+
from lzallright import LZOCompressor, LZOError
2121
import struct
2222
import zlib
2323
from ubireader.ubifs.defines import *
@@ -62,7 +62,7 @@ def decompress(ctype, unc_len, data):
6262
"""
6363
if ctype == UBIFS_COMPR_LZO:
6464
try:
65-
return lzo.decompress(b''.join((b'\xf0', struct.pack('>I', unc_len), data)))
65+
return LZOCompressor.decompress(data, output_size_hint=unc_len)
6666
except Exception as e:
6767
error(decompress, 'Warn', 'LZO Error: %s' % e)
6868
elif ctype == UBIFS_COMPR_ZLIB:

0 commit comments

Comments
 (0)