mirror of
https://github.com/libretro/RetroArch.git
synced 2025-01-19 15:28:25 +00:00
Don't try to access driver->input_data from outside
This commit is contained in:
parent
be71e654f3
commit
3b903adea1
@ -512,7 +512,7 @@ static bool uninit_video_input(void)
|
||||
|
||||
if (
|
||||
!driver->input_data_own &&
|
||||
(driver->input_data != video_data)
|
||||
!input_driver_data_ptr_is_same(video_data)
|
||||
)
|
||||
input_driver_ctl(RARCH_INPUT_CTL_DEINIT, NULL);
|
||||
|
||||
|
@ -621,6 +621,7 @@ retro_input_t input_keys_pressed(void)
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
void **input_driver_get_data_ptr(void)
|
||||
{
|
||||
driver_t *driver = driver_get_ptr();
|
||||
@ -629,6 +630,14 @@ void **input_driver_get_data_ptr(void)
|
||||
return (void**)&driver->input_data;
|
||||
}
|
||||
|
||||
bool input_driver_data_ptr_is_same(void *data)
|
||||
{
|
||||
driver_t *driver = driver_get_ptr();
|
||||
if (!driver)
|
||||
return false;
|
||||
return (driver->input_data == data);
|
||||
}
|
||||
|
||||
bool input_driver_ctl(enum rarch_input_ctl_state state, void *data)
|
||||
{
|
||||
driver_t *driver = driver_get_ptr();
|
||||
|
@ -259,6 +259,8 @@ bool input_driver_ctl(enum rarch_input_ctl_state state, void *data);
|
||||
|
||||
void **input_driver_get_data_ptr(void);
|
||||
|
||||
bool input_driver_data_ptr_is_same(void *data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user