AD: Properly seek to the tail of file for md5 computation

This commit is contained in:
Eugene Sandulenko 2021-10-19 21:08:52 +03:00
parent bd3e2f8e6b
commit 63870b65fa
No known key found for this signature in database
GPG Key ID: 014D387312D34F08
2 changed files with 2 additions and 2 deletions

View File

@ -114,7 +114,7 @@ String MacResManager::computeResForkMD5AsString(uint32 length, bool tail) const
SeekableSubReadStream resForkStream(_stream, dataOffset, dataOffset + dataLength);
if (tail && dataLength > length)
resForkStream.seek(-length, SEEK_END);
resForkStream.seek(-(int64)length, SEEK_END);
return computeStreamMD5AsString(resForkStream, MIN<uint32>(length, _resForkSize));
}

View File

@ -549,7 +549,7 @@ static bool getFilePropertiesIntern(uint md5Bytes, const AdvancedMetaEngine::Fil
if (game.flags & ADGF_TAILMD5) {
if (testFile.size() > md5Bytes)
testFile.seek(-md5Bytes, SEEK_END);
testFile.seek(-(int64)md5Bytes, SEEK_END);
}
fileProps.size = testFile.size();