From ea8f5390154c341f67e3c0d32298e74f13f70f77 Mon Sep 17 00:00:00 2001 From: myst6re Date: Sat, 25 May 2024 18:06:43 +0200 Subject: [PATCH] Fix FS import compression --- src/CLI.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/CLI.cpp b/src/CLI.cpp index d920427..95136ae 100644 --- a/src/CLI.cpp +++ b/src/CLI.cpp @@ -127,14 +127,18 @@ void CLI::commandImport() } QByteArray data = f.readAll(), compressedData; f.close(); - quint32 uncompressedSize = quint32(data.size()); + quint32 uncompressedSize = quint32(data.size()), compressedSize = 0; switch (compressionFormat) { case FiCompression::CompressionLzs: compressedData = LZS::compress(data); + compressedSize = quint32(data.size()); + compressedData.prepend((const char *)&compressedSize, 4); break; case FiCompression::CompressionLz4: compressedData = QLZ4::compress(data); + compressedSize = quint32(data.size()); + compressedData.prepend((const char *)&compressedSize, 4); break; case FiCompression::CompressionNone: case FiCompression::CompressionUnknown: