Skip to content

Commit

Permalink
(camera_driver.c) Prevent null pointer dereference
Browse files Browse the repository at this point in the history
  • Loading branch information
inactive123 committed Sep 28, 2016
1 parent 8194509 commit 4711937
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions camera/camera_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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,
Expand All @@ -239,5 +242,5 @@ bool camera_driver_ctl(enum rarch_camera_ctl_state state, void *data)
break;
}

return false;
return true;
}

0 comments on commit 4711937

Please sign in to comment.