mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-28 00:33:34 +01:00
Fix reads from cache outside the file.
Homebrew seems to all trigger us to read after the end of file, which was looping infinitely. Fixes #8773.
This commit is contained in:
1 parent
8d87a5b7a2
commit
1c357f7f7b
3 files changed
+19
-4
No files matched your search
@@ -82,7 +82,12 @@ size_t DiskCachingFileLoader::ReadAt(s64 absolutePos, size_t bytes, void *data)
|
||||
while (readSize < bytes) {
|
||||
readSize += cache_->SaveIntoCache(backend_, absolutePos + readSize, bytes - readSize, (u8 *)data + readSize);
|
||||
// If there are already-cached blocks afterward, we have to read them.
|
||||
readSize += cache_->ReadFromCache(absolutePos + readSize, bytes - readSize, (u8 *)data + readSize);
|
||||
size_t bytesFromCache = cache_->ReadFromCache(absolutePos + readSize, bytes - readSize, (u8 *)data + readSize);
|
||||
readSize += bytesFromCache;
|
||||
if (bytesFromCache == 0) {
|
||||
// We can't read any more.
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
readSize = backend_->ReadAt(absolutePos, bytes, data);
|
||||
|
||||
Reference in new issue
Block a user