writerperfect/source/common/WPXSvInputStream.cxx |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit f3c742dca6b304da8557f5ca9fb5c287cf5ac934
Author: David Tardon <dtar...@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/50462
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Michael Stahl <mst...@redhat.com>

diff --git a/writerperfect/source/common/WPXSvInputStream.cxx 
b/writerperfect/source/common/WPXSvInputStream.cxx
index 75a56b35fa78..7483a28dbee4 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;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to