From 16adea05af20424a7de4e518cf67385d5c1415ef Mon Sep 17 00:00:00 2001 From: "andrey.bychkov" Date: Mon, 10 Aug 2026 16:26:02 +0300 Subject: [PATCH] fix(picompress): pass correct source size to uncompress() piDecompress() appended original size as 8-byte ullong at the end of compressed data, but passed zba.size() (including the 8 bytes) to uncompress(). This fed trailing metadata as part of the zlib stream. Fix: subtract sizeof(ullong) from source length. --- libs/compress/picompress.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/compress/picompress.cpp b/libs/compress/picompress.cpp index 90e915e9..b52eaa3d 100644 --- a/libs/compress/picompress.cpp +++ b/libs/compress/picompress.cpp @@ -68,7 +68,7 @@ PIByteArray piDecompress(const PIByteArray & zba) { ba.resize(sz); int ret = 0; ulong s = sz; - ret = uncompress(ba.data(), &s, zba.data(), zba.size()); + ret = uncompress(ba.data(), &s, zba.data(), zba.size() - sizeof(ullong)); if (ret != Z_OK) { piCout << "[PICompress]" << "Error: invalid input or not enought memory"_tr("PICompress");