mirror of
https://github.com/libretro/RetroArch
synced 2025-03-28 19:20:35 +00:00
(MFi) Prevent crash when controller player index is unset (-1) (#14999)
This commit is contained in:
parent
347ea8157c
commit
e0c9781b50
@ -166,7 +166,7 @@ static void apple_gamecontroller_joypad_poll(void)
|
||||
for (GCController *controller in [GCController controllers])
|
||||
{
|
||||
/* If we have not assigned a slot to this controller yet, ignore it. */
|
||||
if (controller && (controller.playerIndex < MAX_USERS))
|
||||
if (controller && (controller.playerIndex >= 0) && (controller.playerIndex < MAX_USERS))
|
||||
apple_gamecontroller_joypad_poll_internal(controller, (uint32_t)controller.playerIndex);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user