summaryrefslogtreecommitdiff
path: root/src/android/camera_device.cpp
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2020-12-01 17:12:19 +0100
committerJacopo Mondi <jacopo@jmondi.org>2020-12-02 11:23:20 +0100
commitc5b732b2caacdedde53160e9cf4adc6901fb7454 (patch)
tree25d40e0194c7ee32f02b455c0cda1358248875ec /src/android/camera_device.cpp
parentc268e4f2e8dd45d3538489fa164a043cd25b0453 (diff)
android: camera_device: Check capture_request validity
Make sure the 'camera3_capture_request_t *' provided to CameraDevice::processCaptureRequest() is valid before attempting to access it. This patch fixes cros_camera_test: Camera3FrameTest/Camera3InvalidRequestTest.NullOrUnconfiguredRequest/* Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'src/android/camera_device.cpp')
-rw-r--r--src/android/camera_device.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
index 4eb05df0..675af570 100644
--- a/src/android/camera_device.cpp
+++ b/src/android/camera_device.cpp
@@ -1398,6 +1398,11 @@ FrameBuffer *CameraDevice::createFrameBuffer(const buffer_handle_t camera3buffer
int CameraDevice::processCaptureRequest(camera3_capture_request_t *camera3Request)
{
+ if (!camera3Request) {
+ LOG(HAL, Error) << "No capture request provided";
+ return -EINVAL;
+ }
+
if (!camera3Request->num_output_buffers) {
LOG(HAL, Error) << "No output buffers provided";
return -EINVAL;