Skip to content

Commit

Permalink
OrcLib: EmbeddedResource: fix ExtractToBuffer resource lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
jgautier-anssi authored and fabienfl-orc committed Feb 11, 2021
1 parent 8df375f commit 67ca494
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions src/OrcLib/EmbeddedResource_Extract.cpp
Expand Up @@ -726,18 +726,6 @@ EmbeddedResource::ExtractToBuffer(const std::wstring& szImageFileRessourceID, CB
if (FAILED(hr = extract->Extract(MakeArchiveStream, ShouldItemBeExtracted, MakeWriteStream)))
return hr;

const auto& items = extract->GetExtractedItems();
if (items.empty())
{
Log::Warn(L"Could not locate item '{}' in resource '{}'", NameInArchive, ResName);
return HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND);
}
if (items.size() > 1)
{
Log::Warn(L"{} items matched name '{}' in resource '{}'", items.size(), NameInArchive, ResName);
return HRESULT_FROM_WIN32(ERROR_TOO_MANY_NAMES);
}

if (!pOutput)
{
Log::Warn(L"Invalid output stream for item '{}' in resource '{}'", NameInArchive, ResName);
Expand Down

0 comments on commit 67ca494

Please sign in to comment.