[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
This commit is contained in:
TSRBerry
2023-08-10 05:29:15 +02:00
committed by GitHub
parent 5e9678c8fa
commit fe15c77d30
2 changed files with 22 additions and 16 deletions

View File

@@ -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;
}