ofz: don't loop endlessly on failed skip
Change-Id: Ibc105d8156e1b1ddf22948fb02165f8d03b4cfd5
This commit is contained in:
parent
cd23b010a2
commit
a438651d2b
2 changed files with 6 additions and 2 deletions
BIN
hwpfilter/qa/cppunit/data/fail/skipblock-1.hwp
Normal file
BIN
hwpfilter/qa/cppunit/data/fail/skipblock-1.hwp
Normal file
Binary file not shown.
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue