From 981250daf362b774c2bddfd6822c657ba9c8e9a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sat, 5 Sep 2026 09:27:08 -0600 Subject: [PATCH] ISOFileSystem: Don't crash when the image has no ISO9660 volume The constructor leaves treeroot null when it can't find a CD001 volume descriptor, but GetFromPath walked into it anyway - TreeEntry *entry = treeroot; then entry->valid - so any path lookup on a failed mount dereferenced null. Reachable from the firmware installer, which mounts whatever file it's handed and asks for PSP_GAME/SYSDIR/UPDATE without consulting Error() first. Point it at a PlayStation disc image, whose descriptor sits behind a Mode 2 subheader and so fails the signature check, and PPSSPP goes down. Identify_File checks for CD001 before reporting PSP_ISO, so the game browser was never exposed. Return null instead, which is what the rest of the function already does for a path that isn't there, and what every caller expects. --- Core/FileSystems/ISOFileSystem.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Core/FileSystems/ISOFileSystem.cpp b/Core/FileSystems/ISOFileSystem.cpp index 20994af8b4..ed5d5de936 100644 --- a/Core/FileSystems/ISOFileSystem.cpp +++ b/Core/FileSystems/ISOFileSystem.cpp @@ -335,6 +335,11 @@ const ISOFileSystem::TreeEntry *ISOFileSystem::GetFromPath(std::string_view path if (pathLength <= pathIndex) return treeroot; + if (!treeroot) { + // The constructor gave up - no ISO9660 volume descriptor, or it wouldn't read. + return nullptr; + } + TreeEntry *entry = treeroot; while (true) { if (!entry->valid) {