diff options
Diffstat (limited to '7zip/Archive/Common/InStreamWithCRC.cpp')
-rwxr-xr-x | 7zip/Archive/Common/InStreamWithCRC.cpp | 10 |
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) |