Try to be somewhat safer here in case of null pointer derefences

This commit is contained in:
twinaphex 2017-08-09 02:42:19 +02:00
parent 3a5a2d9de6
commit ca80f13b2b
2 changed files with 4 additions and 3 deletions

View File

@ -100,7 +100,7 @@ static void wiiu_input_poll(void *data)
{
wiiu_input_t *wiiu = (wiiu_input_t*)data;
if (wiiu->joypad)
if (wiiu && wiiu->joypad)
wiiu->joypad->poll();
}

View File

@ -208,8 +208,9 @@ void input_remapping_set_defaults(void)
{
for (j = 0; j < RARCH_FIRST_CUSTOM_BIND; j++)
{
const struct retro_keybind *keybind = &input_config_binds[i][j];
settings->uints.input_remap_ids[i][j] = keybind->id;
const struct retro_keybind *keybind = &input_config_binds[i][j];
if (keybind)
settings->uints.input_remap_ids[i][j] = keybind->id;
}
for (j = 0; j < 4; j++)
settings->uints.input_remap_ids[i][RARCH_FIRST_CUSTOM_BIND + j] = j;