mirror of
https://github.com/libretro/RetroArch
synced 2025-04-02 16:20:39 +00:00
(dynamic.c) Prevent null pointer dereferences
This commit is contained in:
parent
e3c4388f76
commit
aa9dcc2a8e
@ -940,8 +940,6 @@ bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
|
||||
case RETRO_ENVIRONMENT_SET_INPUT_DESCRIPTORS:
|
||||
{
|
||||
unsigned retro_id;
|
||||
const struct retro_input_descriptor *desc = NULL;
|
||||
static const char *libretro_btn_desc[] = {
|
||||
"B (bottom)", "Y (left)", "Select", "Start",
|
||||
"D-Pad Up", "D-Pad Down", "D-Pad Left", "D-Pad Right",
|
||||
@ -949,6 +947,10 @@ bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
"L", "R", "L2", "R2", "L3", "R3",
|
||||
};
|
||||
|
||||
if (system)
|
||||
{
|
||||
unsigned retro_id;
|
||||
const struct retro_input_descriptor *desc = NULL;
|
||||
memset(&system->input_desc_btn, 0,
|
||||
sizeof(system->input_desc_btn));
|
||||
|
||||
@ -1032,6 +1034,7 @@ bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
}
|
||||
|
||||
core_set_input_descriptors();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user