From 77a1eaa7403a4c332485fee1eb46f6cf156ffd07 Mon Sep 17 00:00:00 2001 From: Tillmann Karras Date: Tue, 21 Nov 2023 11:56:19 +0000 Subject: [PATCH] IOS: fix crash when closing invalid file descriptor This regression was introduced in 5.0-20284. --- Source/Core/Core/IOS/IOS.cpp | 2 +- Source/Core/Core/IOS/IOS.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/IOS/IOS.cpp b/Source/Core/Core/IOS/IOS.cpp index 8c08c64001..287e2bcc33 100644 --- a/Source/Core/Core/IOS/IOS.cpp +++ b/Source/Core/Core/IOS/IOS.cpp @@ -654,7 +654,7 @@ std::shared_ptr EmulationKernel::GetDeviceByName(std::string_view device return iterator != m_device_map.end() ? iterator->second : nullptr; } -std::shared_ptr EmulationKernel::GetDeviceByFileDescriptor(const int fd) +std::shared_ptr EmulationKernel::GetDeviceByFileDescriptor(const u32 fd) { if (fd < IPC_MAX_FDS) return m_fdmap[fd]; diff --git a/Source/Core/Core/IOS/IOS.h b/Source/Core/Core/IOS/IOS.h index 2133e155c8..4581e146c2 100644 --- a/Source/Core/Core/IOS/IOS.h +++ b/Source/Core/Core/IOS/IOS.h @@ -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 GetDeviceByName(std::string_view device_name); - std::shared_ptr GetDeviceByFileDescriptor(const int fd); + std::shared_ptr GetDeviceByFileDescriptor(const u32 fd); std::shared_ptr GetFSDevice(); std::shared_ptr GetESDevice();