From a74caa5fb0f0502bc712aa04f8d6a8a0af7fc754 Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Fri, 14 Jun 2019 14:36:28 -1000 Subject: [PATCH] New lzokay API --- lib/ContainerRegistry.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/ContainerRegistry.cpp b/lib/ContainerRegistry.cpp index de869b9..05240af 100644 --- a/lib/ContainerRegistry.cpp +++ b/lib/ContainerRegistry.cpp @@ -486,8 +486,8 @@ static bool ValidateMP2(FILE* fp) { uint8_t compBuf[0x8000]; uint8_t destBuf[0x8000 * 2]; fread(compBuf, 1, chunkSz, fp); - size_t dsz = 0x8000 * 2; - lzokay::decompress(compBuf, chunkSz, destBuf, dsz); + size_t dsz; + lzokay::decompress(compBuf, chunkSz, destBuf, 0x8000 * 2, dsz); memcpy(testBuf, destBuf, 4); } if (amuse::SBig(*reinterpret_cast(testBuf)) == 0x1) @@ -557,8 +557,8 @@ static std::vector> LoadMP2(FIL fread(&chunkSz, 1, 2, fp); chunkSz = SBig(chunkSz); fread(compBuf, 1, chunkSz, fp); - size_t dsz = rem; - lzokay::decompress(compBuf, chunkSz, bufCur, dsz); + size_t dsz; + lzokay::decompress(compBuf, chunkSz, bufCur, rem, dsz); bufCur += dsz; rem -= dsz; }