From 98b594666f826a285e6b92e7fdb732d9afaa4957 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 4 Aug 2020 02:03:02 +0200 Subject: [PATCH] Backport https://github.com/neil4/RetroArch-Lite/commit/d5e2d42008c1da74e49f13b67603ad35b1cc6c7f --- retroarch.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/retroarch.c b/retroarch.c index 772fed4039..1b63fb3f94 100644 --- a/retroarch.c +++ b/retroarch.c @@ -14507,7 +14507,10 @@ static void command_event_init_controllers(struct rarch_state *p_rarch) const char *ident = NULL; bool set_controller = false; const struct retro_controller_description *desc = NULL; - unsigned device = input_config_get_device(i); + unsigned max_users = p_rarch->input_driver_max_users; + unsigned device = (i < max_users) + ? input_config_get_device(i) + : RETRO_DEVICE_NONE; if (info) {