[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - hwpfilter/source

Caolán McNamara caolanm at redhat.com
Fri Feb 24 20:25:18 UTC 2017


 hwpfilter/source/hiodev.cxx |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 0215845ddae1d0bb060a44d2cac0cf0f723024a5
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Feb 23 12:17:33 2017 +0000

    ofz: don't loop endlessly on failed skip
    
    (cherry picked from commit a438651d2b94f14a2a0e54024f69280917df37b5)
    
    Change-Id: Ibc105d8156e1b1ddf22948fb02165f8d03b4cfd5
    Reviewed-on: https://gerrit.libreoffice.org/34608
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>

diff --git a/hwpfilter/source/hiodev.cxx b/hwpfilter/source/hiodev.cxx
index a5e0357..b7be367 100644
--- a/hwpfilter/source/hiodev.cxx
+++ b/hwpfilter/source/hiodev.cxx
@@ -248,8 +248,12 @@ int HStreamIODev::skipBlock(int size)
           else{
                 int remain = size;
                 while(remain){
-                     if( remain > BUFSIZE )
-                          remain -= GZREAD(rBuf, BUFSIZE);
+                     if( remain > BUFSIZE ) {
+                          int read = GZREAD(rBuf, BUFSIZE);
+                          remain -= read;
+                          if (read != BUFSIZE)
+                              break;
+                     }
                      else{
                           remain -= GZREAD(rBuf, remain);
                           break;


More information about the Libreoffice-commits mailing list