mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
Merge pull request #12044 from jdgleaver/input-crash-fix
input_keyboard_event(): Add NULL check (prevents potential segfault when input remaps are disabled)
This commit is contained in:
commit
b8097455ef
@ -25709,19 +25709,19 @@ void input_keyboard_event(bool down, unsigned code,
|
||||
else
|
||||
{
|
||||
retro_keyboard_event_t *key_event = &p_rarch->runloop_key_event;
|
||||
input_mapper_t *handle = p_rarch->input_driver_mapper;
|
||||
bool block = false;
|
||||
|
||||
if (code == RETROK_UNKNOWN ||
|
||||
key_event == NULL)
|
||||
if ((code == RETROK_UNKNOWN) || !key_event)
|
||||
return;
|
||||
|
||||
/* Block hotkey+RetroPad mapped keyboard key events,
|
||||
* but not with game focus and from keyboard device type */
|
||||
if (!p_rarch->game_focus_state.enabled)
|
||||
{
|
||||
input_mapper_t *handle = p_rarch->input_driver_mapper;
|
||||
|
||||
block = BIT512_GET(p_rarch->keyboard_mapping_bits, code);
|
||||
if (block && MAPPER_GET_KEY(handle, code))
|
||||
if (block && handle && MAPPER_GET_KEY(handle, code))
|
||||
block = false;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user