fix a decompress buffer length error

This commit is contained in:
yyc12345 2023-02-18 14:43:29 +08:00
parent 4173de5d2c
commit 58aee73fd6
2 changed files with 2 additions and 2 deletions

View File

@ -239,7 +239,7 @@ namespace LibCmo {
parser->MoveCursor(this->m_FileInfo.DataPackSize); parser->MoveCursor(this->m_FileInfo.DataPackSize);
if (decomp_buffer != nullptr) { if (decomp_buffer != nullptr) {
parser = new(std::nothrow) CKBufferParser(decomp_buffer, this->m_FileInfo.Hdr1UnPackSize, true); parser = new(std::nothrow) CKBufferParser(decomp_buffer, this->m_FileInfo.DataUnPackSize, true);
if (parser == nullptr) { if (parser == nullptr) {
delete[] decomp_buffer; delete[] decomp_buffer;
return CKERROR::CKERR_OUTOFMEMORY; return CKERROR::CKERR_OUTOFMEMORY;

View File

@ -11,7 +11,7 @@ int main(int argc, char* argv[]) {
LibCmo::Utils::VirtoolsEnvironment vtctx; LibCmo::Utils::VirtoolsEnvironment vtctx;
LibCmo::CKFile vtfile(vtctx); LibCmo::CKFile vtfile(vtctx);
LibCmo::CKERROR err = vtfile.Load("Language.old.nmo", LibCmo::CK_LOAD_FLAGS::CK_LOAD_DEFAULT); LibCmo::CKERROR err = vtfile.Load("VeryOldFile.nmo", LibCmo::CK_LOAD_FLAGS::CK_LOAD_DEFAULT);
Unvirt::StructFormatter::PrintCKFileInfo(vtfile.m_FileInfo); Unvirt::StructFormatter::PrintCKFileInfo(vtfile.m_FileInfo);