mirror of
https://github.com/libretro/RetroArch
synced 2025-02-08 06:40:14 +00:00
Merge pull request #6624 from fr500/master
prevent crashing in cores that don't range check retro_set_controller…
This commit is contained in:
commit
68a93e67e9
@ -1015,7 +1015,7 @@ static void command_event_init_controllers(void)
|
|||||||
/* Ideally these checks shouldn't be required but if we always
|
/* Ideally these checks shouldn't be required but if we always
|
||||||
* call core_set_controller_port_device input won't work on
|
* call core_set_controller_port_device input won't work on
|
||||||
* cores that don't set port information properly */
|
* cores that don't set port information properly */
|
||||||
if (info && info->ports.size != 0 && i < info->ports.size)
|
if (info && info->ports.size != 0)
|
||||||
set_controller = true;
|
set_controller = true;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -1029,7 +1029,7 @@ static void command_event_init_controllers(void)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (set_controller)
|
if (set_controller && i < info->ports.size)
|
||||||
{
|
{
|
||||||
pad.device = device;
|
pad.device = device;
|
||||||
pad.port = i;
|
pad.port = i;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user