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 000000000000..8fd8e7abf9fc 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 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;