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