[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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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;
}