From 7b921d3bb75b1c0f3eb574c0016b6e5ee35ce77e Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Thu, 24 Dec 2015 14:31:23 -0800 Subject: [PATCH] Avoid crash when savestate is for different ISO. --- Core/FileSystems/ISOFileSystem.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Core/FileSystems/ISOFileSystem.cpp b/Core/FileSystems/ISOFileSystem.cpp index a5c422a19a..c0ca179931 100644 --- a/Core/FileSystems/ISOFileSystem.cpp +++ b/Core/FileSystems/ISOFileSystem.cpp @@ -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; }