New lzokay API

This commit is contained in:
Jack Andersen 2019-06-14 14:36:28 -10:00
parent 2a3444400e
commit a74caa5fb0
1 changed files with 4 additions and 4 deletions

View File

@ -486,8 +486,8 @@ static bool ValidateMP2(FILE* fp) {
uint8_t compBuf[0x8000]; uint8_t compBuf[0x8000];
uint8_t destBuf[0x8000 * 2]; uint8_t destBuf[0x8000 * 2];
fread(compBuf, 1, chunkSz, fp); fread(compBuf, 1, chunkSz, fp);
size_t dsz = 0x8000 * 2; size_t dsz;
lzokay::decompress(compBuf, chunkSz, destBuf, dsz); lzokay::decompress(compBuf, chunkSz, destBuf, 0x8000 * 2, dsz);
memcpy(testBuf, destBuf, 4); memcpy(testBuf, destBuf, 4);
} }
if (amuse::SBig(*reinterpret_cast<uint32_t*>(testBuf)) == 0x1) if (amuse::SBig(*reinterpret_cast<uint32_t*>(testBuf)) == 0x1)
@ -557,8 +557,8 @@ static std::vector<std::pair<SystemString, IntrusiveAudioGroupData>> LoadMP2(FIL
fread(&chunkSz, 1, 2, fp); fread(&chunkSz, 1, 2, fp);
chunkSz = SBig(chunkSz); chunkSz = SBig(chunkSz);
fread(compBuf, 1, chunkSz, fp); fread(compBuf, 1, chunkSz, fp);
size_t dsz = rem; size_t dsz;
lzokay::decompress(compBuf, chunkSz, bufCur, dsz); lzokay::decompress(compBuf, chunkSz, bufCur, rem, dsz);
bufCur += dsz; bufCur += dsz;
rem -= dsz; rem -= dsz;
} }