Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/kornelski/7z.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '7zip/Archive/Common/InStreamWithCRC.cpp')
-rwxr-xr-x7zip/Archive/Common/InStreamWithCRC.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/7zip/Archive/Common/InStreamWithCRC.cpp b/7zip/Archive/Common/InStreamWithCRC.cpp
index 86151b9d..74dff7e1 100755
--- a/7zip/Archive/Common/InStreamWithCRC.cpp
+++ b/7zip/Archive/Common/InStreamWithCRC.cpp
@@ -4,23 +4,25 @@
#include "InStreamWithCRC.h"
-STDMETHODIMP CSequentialInStreamWithCRC::Read(void *data,
- UInt32 size, UInt32 *processedSize)
+STDMETHODIMP CSequentialInStreamWithCRC::Read(void *data, UInt32 size, UInt32 *processedSize)
{
UInt32 realProcessedSize;
HRESULT result = _stream->Read(data, size, &realProcessedSize);
_size += realProcessedSize;
+ if (size > 0 && realProcessedSize == 0)
+ _wasFinished = true;
_crc.Update(data, realProcessedSize);
if(processedSize != NULL)
*processedSize = realProcessedSize;
return result;
}
-STDMETHODIMP CInStreamWithCRC::Read(void *data,
- UInt32 size, UInt32 *processedSize)
+STDMETHODIMP CInStreamWithCRC::Read(void *data, UInt32 size, UInt32 *processedSize)
{
UInt32 realProcessedSize;
HRESULT result = _stream->Read(data, size, &realProcessedSize);
+ if (size > 0 && realProcessedSize == 0)
+ _wasFinished = true;
_size += realProcessedSize;
_crc.Update(data, realProcessedSize);
if(processedSize != NULL)