diff options
Diffstat (limited to '7zip/Compress/Branch/x86_2.cpp')
-rwxr-xr-x | 7zip/Compress/Branch/x86_2.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/7zip/Compress/Branch/x86_2.cpp b/7zip/Compress/Branch/x86_2.cpp index 2f67899f..00f1ea7a 100755 --- a/7zip/Compress/Branch/x86_2.cpp +++ b/7zip/Compress/Branch/x86_2.cpp @@ -102,7 +102,6 @@ HRESULT CBCJ2_x86_Encoder::CodeReal(ISequentialInStream **inStreams, UInt32 nowPos = 0; UInt64 nowPos64 = 0; UInt32 bufferPos = 0; - UInt32 processedSize; Byte prevByte = 0; @@ -112,8 +111,18 @@ HRESULT CBCJ2_x86_Encoder::CodeReal(ISequentialInStream **inStreams, while(true) { - UInt32 size = kBufferSize - bufferPos; - RINOK(inStream->Read(_buffer + bufferPos, size, &processedSize)); + UInt32 processedSize = 0; + while(true) + { + UInt32 size = kBufferSize - (bufferPos + processedSize); + UInt32 processedSizeLoc; + if (size == 0) + break; + RINOK(inStream->Read(_buffer + bufferPos + processedSize, size, &processedSizeLoc)); + if (processedSizeLoc == 0) + break; + processedSize += processedSizeLoc; + } UInt32 endPos = bufferPos + processedSize; if (endPos < 5) |