ofz: don't loop endlessly on failed skip
Change-Id: Ibc105d8156e1b1ddf22948fb02165f8d03b4cfd5
This commit is contained in:
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{
|
else{
|
||||||
int remain = size;
|
int remain = size;
|
||||||
while(remain){
|
while(remain){
|
||||||
if( remain > BUFSIZE )
|
if( remain > BUFSIZE ) {
|
||||||
remain -= GZREAD(rBuf, BUFSIZE);
|
int read = GZREAD(rBuf, BUFSIZE);
|
||||||
|
remain -= read;
|
||||||
|
if (read != BUFSIZE)
|
||||||
|
break;
|
||||||
|
}
|
||||||
else{
|
else{
|
||||||
remain -= GZREAD(rBuf, remain);
|
remain -= GZREAD(rBuf, remain);
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user