diff options
author | Igor Pavlov <ipavlov@users.sourceforge.net> | 2018-01-12 00:16:32 +0300 |
---|---|---|
committer | Kornel <kornel@geekhood.net> | 2018-01-12 00:16:32 +0300 |
commit | da28077952faf9e716ed7987b842d31617a10125 (patch) | |
tree | 5903be6aa5f1405d54028cec42432c46df818af5 /CPP/7zip/Compress/Rar1Decoder.cpp | |
parent | b5dc853b2496447f0a54b3b25cb2659b575c56ef (diff) |
18.0018.00
Diffstat (limited to 'CPP/7zip/Compress/Rar1Decoder.cpp')
-rw-r--r-- | CPP/7zip/Compress/Rar1Decoder.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/CPP/7zip/Compress/Rar1Decoder.cpp b/CPP/7zip/Compress/Rar1Decoder.cpp index 0a552506..f5f3a79d 100644 --- a/CPP/7zip/Compress/Rar1Decoder.cpp +++ b/CPP/7zip/Compress/Rar1Decoder.cpp @@ -29,7 +29,7 @@ public: }; */ -CDecoder::CDecoder(): m_IsSolid(false) { } +CDecoder::CDecoder(): m_IsSolid(false), _errorMode(false) { } void CDecoder::InitStructures() { @@ -406,9 +406,14 @@ HRESULT CDecoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream * InitData(); if (!m_IsSolid) { + _errorMode = false; InitStructures(); InitHuff(); } + + if (_errorMode) + return S_FALSE; + if (m_UnpackSize > 0) { GetFlagsBuf(); @@ -477,9 +482,9 @@ STDMETHODIMP CDecoder::Code(ISequentialInStream *inStream, ISequentialOutStream const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress) { try { return CodeReal(inStream, outStream, inSize, outSize, progress); } - catch(const CInBufferException &e) { return e.ErrorCode; } - catch(const CLzOutWindowException &e) { return e.ErrorCode; } - catch(...) { return S_FALSE; } + catch(const CInBufferException &e) { _errorMode = true; return e.ErrorCode; } + catch(const CLzOutWindowException &e) { _errorMode = true; return e.ErrorCode; } + catch(...) { _errorMode = true; return S_FALSE; } } STDMETHODIMP CDecoder::SetDecoderProperties2(const Byte *data, UInt32 size) |