diff options
author | Igor Pavlov <ipavlov@users.sourceforge.net> | 2008-05-05 04:00:00 +0400 |
---|---|---|
committer | Kornel LesiĆski <kornel@geekhood.net> | 2016-05-28 02:15:55 +0300 |
commit | 3901bf0ab88106a5b031cba7bc18d60cdebf7eef (patch) | |
tree | 808a2489abed822223b118b64e0553db80af6087 /CPP/7zip/Archive/BZip2/BZip2Handler.cpp | |
parent | bd1fa36322ac27f5715433b388742893d6524516 (diff) |
4.58 beta
Diffstat (limited to 'CPP/7zip/Archive/BZip2/BZip2Handler.cpp')
-rwxr-xr-x | CPP/7zip/Archive/BZip2/BZip2Handler.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/CPP/7zip/Archive/BZip2/BZip2Handler.cpp b/CPP/7zip/Archive/BZip2/BZip2Handler.cpp index 0b790c68..c88c883f 100755 --- a/CPP/7zip/Archive/BZip2/BZip2Handler.cpp +++ b/CPP/7zip/Archive/BZip2/BZip2Handler.cpp @@ -56,10 +56,7 @@ STDMETHODIMP CHandler::Open(IInStream *stream, RINOK(stream->Seek(0, STREAM_SEEK_CUR, &_streamStartPosition)); const int kSignatureSize = 3; Byte buffer[kSignatureSize]; - UInt32 processedSize; - RINOK(ReadStream(stream, buffer, kSignatureSize, &processedSize)); - if (processedSize != kSignatureSize) - return S_FALSE; + RINOK(ReadStream_FALSE(stream, buffer, kSignatureSize)); if (buffer[0] != 'B' || buffer[1] != 'Z' || buffer[2] != 'h') return S_FALSE; @@ -166,9 +163,9 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, const int kSignatureSize = 3; Byte buffer[kSignatureSize]; - UInt32 processedSize; - RINOK(ReadStream(_stream, buffer, kSignatureSize, &processedSize)); - if (processedSize < kSignatureSize) + size_t processedSize = kSignatureSize; + RINOK(ReadStream(_stream, buffer, &processedSize)); + if (processedSize != kSignatureSize) { if (firstItem) return E_FAIL; |