IOS: fix crash when closing invalid file descriptor

This regression was introduced in 5.0-20284.
This commit is contained in:
Tillmann Karras 2023-11-21 11:56:19 +00:00
parent f79c88f30b
commit 77a1eaa740
2 changed files with 2 additions and 2 deletions

View File

@ -654,7 +654,7 @@ std::shared_ptr<Device> EmulationKernel::GetDeviceByName(std::string_view device
return iterator != m_device_map.end() ? iterator->second : nullptr;
}
std::shared_ptr<Device> EmulationKernel::GetDeviceByFileDescriptor(const int fd)
std::shared_ptr<Device> EmulationKernel::GetDeviceByFileDescriptor(const u32 fd)
{
if (fd < IPC_MAX_FDS)
return m_fdmap[fd];

View File

@ -154,7 +154,7 @@ public:
// Get a resource manager by name.
// This only works for devices which are part of the device map.
std::shared_ptr<Device> GetDeviceByName(std::string_view device_name);
std::shared_ptr<Device> GetDeviceByFileDescriptor(const int fd);
std::shared_ptr<Device> GetDeviceByFileDescriptor(const u32 fd);
std::shared_ptr<FSDevice> GetFSDevice();
std::shared_ptr<ESDevice> GetESDevice();