ofz: don't loop endlessly on failed skip

Change-Id: Ibc105d8156e1b1ddf22948fb02165f8d03b4cfd5
This commit is contained in:
Caolán McNamara 2017-02-23 12:17:33 +00:00
parent cd23b010a2
commit a438651d2b
2 changed files with 6 additions and 2 deletions

Binary file not shown.

View file

@ -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;