Avoid crash when savestate is for different ISO.

This commit is contained in:
Unknown W. Brackets 2015-12-24 14:31:23 -08:00
parent d5219ebafc
commit 7b921d3bb7

View file

@ -555,8 +555,10 @@ size_t ISOFileSystem::ReadFile(u32 handle, u8 *pointer, s64 size, int &usec)
if (e.isRawSector) {
positionOnIso = e.sectorStart * 2048ULL + e.seekPos;
fileSize = (s64)e.openSize;
} else if (e.file == nullptr) {
ERROR_LOG(FILESYS, "File no longer exists (loaded savestate with different ISO?)");
return 0;
} else {
_dbg_assert_msg_(FILESYS, e.file != 0, "Expecting non-raw fd to have a tree entry.");
positionOnIso = e.file->startingPosition + e.seekPos;
fileSize = e.file->size;
}