Don't call input_remote_state unless pointer is non-NULL

This commit is contained in:
twinaphex 2017-04-20 10:57:09 +02:00
parent 69a3bf6a31
commit d1664481c2
2 changed files with 6 additions and 6 deletions

View File

@ -398,7 +398,8 @@ int16_t input_state(unsigned port, unsigned device,
#endif
#ifdef HAVE_NETWORKGAMEPAD
input_remote_state(&res, port, device, idx, id);
if (input_driver_remote)
input_remote_state(&res, port, device, idx, id);
#endif
/* Don't allow turbo for D-pad. */

View File

@ -192,11 +192,6 @@ void input_remote_state(
unsigned idx,
unsigned id)
{
input_remote_state_t *ol_state = input_remote_get_state_ptr();
if (!ol_state)
return;
switch (device)
{
case RETRO_DEVICE_JOYPAD:
@ -206,6 +201,10 @@ void input_remote_state(
case RETRO_DEVICE_ANALOG:
{
unsigned base = 0;
input_remote_state_t *ol_state = input_remote_get_state_ptr();
if (!ol_state)
return;
if (idx == RETRO_DEVICE_INDEX_ANALOG_RIGHT)
base = 2;