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/OutStreamWithCRC.cpp')
-rwxr-xr-x7zip/Archive/Common/OutStreamWithCRC.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/7zip/Archive/Common/OutStreamWithCRC.cpp b/7zip/Archive/Common/OutStreamWithCRC.cpp
index 4fbce564..7ac3f123 100755
--- a/7zip/Archive/Common/OutStreamWithCRC.cpp
+++ b/7zip/Archive/Common/OutStreamWithCRC.cpp
@@ -4,8 +4,7 @@
#include "OutStreamWithCRC.h"
-STDMETHODIMP COutStreamWithCRC::Write(const void *data,
- UInt32 size, UInt32 *processedSize)
+STDMETHODIMP COutStreamWithCRC::Write(const void *data, UInt32 size, UInt32 *processedSize)
{
UInt32 realProcessedSize;
HRESULT result;
@@ -16,7 +15,9 @@ STDMETHODIMP COutStreamWithCRC::Write(const void *data,
}
else
result = _stream->Write(data, size, &realProcessedSize);
- _crc.Update(data, realProcessedSize);
+ if (_calculateCrc)
+ _crc.Update(data, realProcessedSize);
+ _size += realProcessedSize;
if(processedSize != NULL)
*processedSize = realProcessedSize;
return result;