Commit 579d6752 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

input-freeze-fix.patch from Nathanael

parent 5ac93df3
......@@ -236,7 +236,7 @@ static ssize_t scanToGribMarker(CdiGribIterator *me)
if(scannedBytes + scanSize > kMaxScanSize) scanSize = kMaxScanSize - scannedBytes;
assert(scanSize <= me->bufferSize);
int status = cdiInputFile_read(me->file, me->fileOffset + (off_t)scannedBytes, scanSize, &scanSize, me->gribBuffer);
if(status != CDI_NOERR && status != CDI_EEOF) return status;
if(status != CDI_NOERR && status != CDI_EEOF) return -1;
const unsigned char *startPosition = positionOfGribMarker(me->gribBuffer, scanSize);
if(startPosition)
......@@ -246,8 +246,8 @@ static ssize_t scanToGribMarker(CdiGribIterator *me)
//Get the offset for the next iteration if there is a next iteration.
scanSize -= 3; //so that we won't miss a 'GRIB' sequence that happens to be cut off
scannedBytes += scanSize;
scannedBytes &= ~(size_t)0xf; //make 16 bytes aligned
scanSize &= ~(size_t)0xf; //make 16 bytes aligned
if((ssize_t)scanSize <= 0) return -1; //ensure that we make progress
}
return -1;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment