[Libreoffice-commits] core.git: hwpfilter/qa hwpfilter/source
Caolán McNamara
caolanm at redhat.com
Thu Feb 23 12:18:41 UTC 2017
hwpfilter/qa/cppunit/data/fail/skipblock-1.hwp |binary
hwpfilter/source/hiodev.cxx | 8 ++++++--
2 files changed, 6 insertions(+), 2 deletions(-)
New commits:
commit a438651d2b94f14a2a0e54024f69280917df37b5
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
Change-Id: Ibc105d8156e1b1ddf22948fb02165f8d03b4cfd5
diff --git a/hwpfilter/qa/cppunit/data/fail/skipblock-1.hwp b/hwpfilter/qa/cppunit/data/fail/skipblock-1.hwp
new file mode 100644
index 0000000..8fd8e7a
Binary files /dev/null and b/hwpfilter/qa/cppunit/data/fail/skipblock-1.hwp differ
diff --git a/hwpfilter/source/hiodev.cxx b/hwpfilter/source/hiodev.cxx
index 98001e9..48d105f 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;
More information about the Libreoffice-commits
mailing list