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

View File

@@ -561,6 +561,8 @@ int VirtualDiscFileSystem::Ioctl(u32 handle, u32 cmd, u32 indataPtr, u32 inlen,
PSPDevType VirtualDiscFileSystem::DevType(u32 handle) {
EntryMap::iterator iter = entries.find(handle);
if (iter == entries.end())
return PSPDevType::FILE;
PSPDevType type = iter->second.type == VFILETYPE_ISO ? PSPDevType::BLOCK : PSPDevType::FILE;
if (iter->second.type == VFILETYPE_LBN)
type |= PSPDevType::EMU_LBN;