diff options
author | Igor Pavlov <ipavlov@users.sourceforge.net> | 2011-04-11 04:00:00 +0400 |
---|---|---|
committer | Kornel LesiĆski <kornel@geekhood.net> | 2016-05-28 02:16:05 +0300 |
commit | 35596517f203f1c4970413b3b5b2e216b849e462 (patch) | |
tree | 93240df3eb4ddbd8eebbe6a5fc65e93f2ccb6495 /CPP/7zip/Archive/Cab | |
parent | de4f8c22fe4b9e59b60495b84db2e81de50999a9 (diff) |
9.219.21
Diffstat (limited to 'CPP/7zip/Archive/Cab')
-rwxr-xr-x | CPP/7zip/Archive/Cab/CabHandler.cpp | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/CPP/7zip/Archive/Cab/CabHandler.cpp b/CPP/7zip/Archive/Cab/CabHandler.cpp index 20f670d3..fd707fe5 100755 --- a/CPP/7zip/Archive/Cab/CabHandler.cpp +++ b/CPP/7zip/Archive/Cab/CabHandler.cpp @@ -4,9 +4,7 @@ #include "../../../../C/Alloc.h" -#include "Common/Buffer.h" #include "Common/ComTry.h" -#include "Common/Defs.h" #include "Common/IntToString.h" #include "Common/StringConvert.h" #include "Common/UTFConvert.h" @@ -654,7 +652,7 @@ STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems, bool allFilesMode = (numItems == (UInt32)-1); if (allFilesMode) numItems = m_Database.Items.Size(); - if(numItems == 0) + if (numItems == 0) return S_OK; bool testMode = (testModeSpec != 0); UInt64 totalUnPacked = 0; @@ -780,12 +778,13 @@ STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems, curUnpack, extractCallback, testMode); cabBlockInStreamSpec->MsZip = false; + HRESULT res = S_OK; switch(folder.GetCompressionMethod()) { case NHeader::NCompressionMethodMajor::kNone: break; case NHeader::NCompressionMethodMajor::kMSZip: - if(deflateDecoderSpec == NULL) + if (!deflateDecoder) { deflateDecoderSpec = new NCompress::NDeflate::NDecoder::CCOMCoder; deflateDecoder = deflateDecoderSpec; @@ -793,33 +792,35 @@ STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems, cabBlockInStreamSpec->MsZip = true; break; case NHeader::NCompressionMethodMajor::kLZX: - if(lzxDecoderSpec == NULL) + if (!lzxDecoder) { lzxDecoderSpec = new NCompress::NLzx::CDecoder; lzxDecoder = lzxDecoderSpec; } - RINOK(lzxDecoderSpec->SetParams(folder.CompressionTypeMinor)); + res = lzxDecoderSpec->SetParams(folder.CompressionTypeMinor); break; case NHeader::NCompressionMethodMajor::kQuantum: - if(quantumDecoderSpec == NULL) + if (!quantumDecoder) { quantumDecoderSpec = new NCompress::NQuantum::CDecoder; quantumDecoder = quantumDecoderSpec; } - quantumDecoderSpec->SetParams(folder.CompressionTypeMinor); + res = quantumDecoderSpec->SetParams(folder.CompressionTypeMinor); break; default: - { - RINOK(cabFolderOutStream->Unsupported()); - totalUnPacked += curUnpack; - continue; - } + res = E_INVALIDARG; + break; } - cabBlockInStreamSpec->InitForNewFolder(); - - HRESULT res = S_OK; + if (res == E_INVALIDARG) + { + RINOK(cabFolderOutStream->Unsupported()); + totalUnPacked += curUnpack; + continue; + } + RINOK(res); + cabBlockInStreamSpec->InitForNewFolder(); { int volIndex = mvItem.VolumeIndex; int locFolderIndex = item.GetFolderIndex(db.Folders.Size()); |