summaryrefslogtreecommitdiff
path: root/hwpfilter
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-02-23 12:17:33 +0000
committerAndras Timar <andras.timar@collabora.com>2017-03-01 13:46:45 +0100
commit5d371f581b09c9c59779243c92d55347a0787aa6 (patch)
treea68295d0bd0a147fd7ff82e2d9d7d29167047c80 /hwpfilter
parent4d3b4630dd039d942fcef7ab7a3a6d664381f525 (diff)
ofz: don't loop endlessly on failed skip
(cherry picked from commit a438651d2b94f14a2a0e54024f69280917df37b5) Change-Id: Ibc105d8156e1b1ddf22948fb02165f8d03b4cfd5 Reviewed-on: https://gerrit.libreoffice.org/34576 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit fddffda26287dec1f42a04bd40b8b2782982a7e0)
Diffstat (limited to 'hwpfilter')
-rw-r--r--hwpfilter/source/hiodev.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/hwpfilter/source/hiodev.cxx b/hwpfilter/source/hiodev.cxx
index 98001e99a6a8..48d105ff23ed 100644
--- a/hwpfilter/source/hiodev.cxx
+++ b/hwpfilter/source/hiodev.cxx
@@ -242,8 +242,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;