From 58aee73fd61e5d611b26ceb4033000e8b327f4cc Mon Sep 17 00:00:00 2001 From: yyc12345 Date: Sat, 18 Feb 2023 14:43:29 +0800 Subject: [PATCH] fix a decompress buffer length error --- LibCmo/VTReader.cpp | 2 +- Unvirt/Unvirt.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/LibCmo/VTReader.cpp b/LibCmo/VTReader.cpp index 6436a8a..d469067 100644 --- a/LibCmo/VTReader.cpp +++ b/LibCmo/VTReader.cpp @@ -239,7 +239,7 @@ namespace LibCmo { parser->MoveCursor(this->m_FileInfo.DataPackSize); 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) { delete[] decomp_buffer; return CKERROR::CKERR_OUTOFMEMORY; diff --git a/Unvirt/Unvirt.cpp b/Unvirt/Unvirt.cpp index ed9b681..0d13dc4 100644 --- a/Unvirt/Unvirt.cpp +++ b/Unvirt/Unvirt.cpp @@ -11,7 +11,7 @@ int main(int argc, char* argv[]) { LibCmo::Utils::VirtoolsEnvironment 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);