mirror of
https://github.com/libretro/RetroArch
synced 2024-12-28 09:29:16 +00:00
(camera_driver.c) Prevent null pointer dereference
This commit is contained in:
parent
8194509b21
commit
4711937c9c
@ -194,7 +194,7 @@ bool camera_driver_ctl(enum rarch_camera_ctl_state state, void *data)
|
||||
runloop_msg_queue_push(
|
||||
"Camera is explicitly disabled.\n", 1, 180, false);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case RARCH_CAMERA_CTL_POLL:
|
||||
if (!camera_cb.caps)
|
||||
return false;
|
||||
@ -218,6 +218,9 @@ bool camera_driver_ctl(enum rarch_camera_ctl_state state, void *data)
|
||||
|
||||
camera_driver_ctl(RARCH_CAMERA_CTL_FIND_DRIVER, NULL);
|
||||
|
||||
if (!camera_driver)
|
||||
return false;
|
||||
|
||||
camera_data = camera_driver->init(
|
||||
*settings->camera.device ? settings->camera.device : NULL,
|
||||
camera_cb.caps,
|
||||
@ -239,5 +242,5 @@ bool camera_driver_ctl(enum rarch_camera_ctl_state state, void *data)
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user