Io: Prevent error on bad handle for DevType().

This commit is contained in:
Unknown W. Brackets
2021-04-21 20:11:23 -07:00
parent 2932a9995f
commit 1aae6e5ffc
2 changed files with 4 additions and 0 deletions
+2
View File
@@ -439,6 +439,8 @@ int ISOFileSystem::Ioctl(u32 handle, u32 cmd, u32 indataPtr, u32 inlen, u32 outd
PSPDevType ISOFileSystem::DevType(u32 handle) {
EntryMap::iterator iter = entries.find(handle);
if (iter == entries.end())
return PSPDevType::FILE;
PSPDevType type = iter->second.isBlockSectorMode ? PSPDevType::BLOCK : PSPDevType::FILE;
if (iter->second.isRawSector)
type |= PSPDevType::EMU_LBN;