diff --git a/IO/src/ImageFile.cpp b/IO/src/ImageFile.cpp index bbb0576..bb9e852 100644 --- a/IO/src/ImageFile.cpp +++ b/IO/src/ImageFile.cpp @@ -204,7 +204,7 @@ unsigned char *ImageFile::ReadFileData(const CHAR *filename) { uint64 totalBytesLeft = fileSize; uint32 bytesToRead = uint32(std::min(totalBytesLeft, uint64(1 << 31))); int32 bytesRead; - while((bytesRead = fstr.Read(rawData, uint32(fileSize))) >= 0) { + while((bytesRead = fstr.Read(rawData, uint32(fileSize))) > 0) { totalBytesRead += bytesRead; totalBytesLeft -= bytesRead; }