mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-24 00:20:01 +00:00
input_keyboard_event(): Add NULL check (prevents potential segfault when input remaps are disabled)
This commit is contained in:
parent
06b77bab18
commit
4b70fbcd86
@ -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…
Reference in New Issue
Block a user