summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--writerperfect/source/common/WPXSvInputStream.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/writerperfect/source/common/WPXSvInputStream.cxx b/writerperfect/source/common/WPXSvInputStream.cxx
index c44175e5f485..83ea69cc348b 100644
--- a/writerperfect/source/common/WPXSvInputStream.cxx
+++ b/writerperfect/source/common/WPXSvInputStream.cxx
@@ -877,7 +877,10 @@ const unsigned char *WPXSvInputStream::read(unsigned long numBytes, unsigned lon
if (!mpImpl->mnReadBufferLength)
return nullptr;
- numBytesRead = numBytes;
+ if (numBytes <= mpImpl->mnReadBufferLength)
+ numBytesRead = numBytes;
+ else
+ numBytesRead = mpImpl->mnReadBufferLength;
mpImpl->mnReadBufferPos += numBytesRead;
return mpImpl->mpReadBuffer;