Skip to content

Commit

Permalink
Fix crash issue when using Open Inside # mode for the WebAssembly (WA…
Browse files Browse the repository at this point in the history
…SM) binary file readonly support for NanaZip.Codecs.
  • Loading branch information
MouriNaruto committed Feb 4, 2025
1 parent 52f5bdd commit 4c69477
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions NanaZip.Codecs/NanaZip.Codecs.Archive.WebAssembly.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,10 @@ namespace NanaZip::Codecs::Archive
Sections.emplace(Section.Name, Section);
i += Size;
}
if (!this->m_FullSize && !Sections.empty())
{
this->m_FullSize = BundleSize;
}

std::uint64_t TotalFiles = Sections.size();
std::uint64_t TotalBytes = this->m_FullSize;
Expand Down Expand Up @@ -551,8 +555,6 @@ namespace NanaZip::Codecs::Archive
_In_ PROPID PropId,
_Inout_ LPPROPVARIANT Value)
{
UNREFERENCED_PARAMETER(PropId);

if (!this->m_IsInitialized)
{
return S_FALSE;
Expand All @@ -563,6 +565,18 @@ namespace NanaZip::Codecs::Archive
return E_INVALIDARG;
}

switch (PropId)
{
case SevenZipArchivePhysicalSize:
{
Value->uhVal.QuadPart = this->m_FullSize;
Value->vt = VT_UI8;
break;
}
default:
break;
}

return S_OK;
}

Expand Down

0 comments on commit 4c69477

Please sign in to comment.