aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.HLE/HOS/Services
diff options
context:
space:
mode:
authorTSRBerry <20988865+TSRBerry@users.noreply.github.com>2023-08-10 05:29:15 +0200
committerGitHub <noreply@github.com>2023-08-10 00:29:15 -0300
commitfe15c77d30b94a8b720b520dcacf39a0c832d58f (patch)
treebe85b986eee34ca878efeeb5c857a4ddb1b7ffb9 /src/Ryujinx.HLE/HOS/Services
parent5e9678c8fad4625026268e457f4c3e23bdc22697 (diff)
[Hotfix] hid: Prevent out of bounds array access (#5547)
* hid: Prevent out of bounds array access * Cast player to uint * Replace lambda function with local function
Diffstat (limited to 'src/Ryujinx.HLE/HOS/Services')
-rw-r--r--src/Ryujinx.HLE/HOS/Services/Hid/HidDevices/NpadDevices.cs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Ryujinx.HLE/HOS/Services/Hid/HidDevices/NpadDevices.cs b/src/Ryujinx.HLE/HOS/Services/Hid/HidDevices/NpadDevices.cs
index 240933ad..86c6a825 100644
--- a/src/Ryujinx.HLE/HOS/Services/Hid/HidDevices/NpadDevices.cs
+++ b/src/Ryujinx.HLE/HOS/Services/Hid/HidDevices/NpadDevices.cs
@@ -70,6 +70,11 @@ namespace Ryujinx.HLE.HOS.Services.Hid
internal void SetSupportedPlayer(PlayerIndex player, bool supported = true)
{
+ if ((uint)player >= _supportedPlayers.Length)
+ {
+ return;
+ }
+
_supportedPlayers[(int)player] = supported;
}