mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00: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
@@ -72,7 +72,12 @@ size_t CachingFileLoader::ReadAt(s64 absolutePos, size_t bytes, void *data) {
|
||||
// While in case the cache size is too small for the entire read.
|
||||
while (readSize < bytes) {
|
||||
SaveIntoCache(absolutePos + readSize, bytes - readSize);
|
||||
readSize += ReadFromCache(absolutePos + readSize, bytes - readSize, (u8 *)data + readSize);
|
||||
size_t bytesFromCache = ReadFromCache(absolutePos + readSize, bytes - readSize, (u8 *)data + readSize);
|
||||
readSize += bytesFromCache;
|
||||
if (bytesFromCache == 0) {
|
||||
// We can't read any more.
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
StartReadAhead(absolutePos + readSize);
|
||||
|
||||
Reference in new issue
Block a user