From ff22a32a61552207df31591f776cafebc856242a Mon Sep 17 00:00:00 2001 From: refractionpcsx2 Date: Tue, 29 Nov 2022 16:04:12 +0000 Subject: [PATCH] CDVD: Escape descriptor read on iso read failure --- pcsx2/CDVD/IsoFS/IsoFS.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pcsx2/CDVD/IsoFS/IsoFS.cpp b/pcsx2/CDVD/IsoFS/IsoFS.cpp index f613d59fa0..23ed40600d 100644 --- a/pcsx2/CDVD/IsoFS/IsoFS.cpp +++ b/pcsx2/CDVD/IsoFS/IsoFS.cpp @@ -62,7 +62,10 @@ IsoDirectory::IsoDirectory(SectorSource& r) while (!done) { u8 sector[2048]; - internalReader.readSector(sector, i); + // If this fails, we're not reading an iso, or it's bad. + if (!internalReader.readSector(sector, i)) + break; + if (memcmp(§or[1], "CD001", 5) == 0) { switch (sector[0])