From af033a2c9af39c3c9bcbd74cb2e62c1e4875f5ab Mon Sep 17 00:00:00 2001 From: m1stadev Date: Fri, 5 Apr 2024 12:50:14 -0500 Subject: [PATCH] parser: Fix incorrect compression type for LZFSE_ENCRYPTED Image4 payloads --- pyimg4/parser.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyimg4/parser.py b/pyimg4/parser.py index d195f00..e5ff899 100644 --- a/pyimg4/parser.py +++ b/pyimg4/parser.py @@ -1271,6 +1271,9 @@ def size(self, size: int) -> None: if 0 < size < len(self.data): raise ValueError('Size cannot be less than the length of the payload data.') + if self.encrypted is True: + self._detect_compression(size, self._data) + self._size = size def add_keybag(self, keybag: Keybag) -> None: