[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - writerperfect/source
David Tardon
dtardon at redhat.com
Tue Feb 27 19:42:11 UTC 2018
writerperfect/source/common/WPXSvInputStream.cxx | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
New commits:
commit 1b1f416244ace9ab3eb532cc4ab242486cd1930d
Author: David Tardon <dtardon at redhat.com>
Date: Tue Feb 27 17:47:19 2018 +0100
set number of read bytes correctly
It was wrong if we read less than was expected.
Thanks to Antti Levomäki and Christian Jalio from Forcepoint.
Change-Id: I070c1731d1aace4c101fa01efed0c28734c44899
(cherry picked from commit 9534a8fe3e84bfcc7d0d2addac4dd8cd96746d99)
Reviewed-on: https://gerrit.libreoffice.org/50463
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Michael Stahl <mstahl at redhat.com>
diff --git a/writerperfect/source/common/WPXSvInputStream.cxx b/writerperfect/source/common/WPXSvInputStream.cxx
index c3e4477781e7..54204cf60768 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;
More information about the Libreoffice-commits
mailing list