mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-13 23:39:44 +03:00
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>
This commit is contained in:
parent
c268e4f2e8
commit
c5b732b2ca
1 changed files with 5 additions and 0 deletions
|
@ -1398,6 +1398,11 @@ FrameBuffer *CameraDevice::createFrameBuffer(const buffer_handle_t camera3buffer
|
||||||
|
|
||||||
int CameraDevice::processCaptureRequest(camera3_capture_request_t *camera3Request)
|
int CameraDevice::processCaptureRequest(camera3_capture_request_t *camera3Request)
|
||||||
{
|
{
|
||||||
|
if (!camera3Request) {
|
||||||
|
LOG(HAL, Error) << "No capture request provided";
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
if (!camera3Request->num_output_buffers) {
|
if (!camera3Request->num_output_buffers) {
|
||||||
LOG(HAL, Error) << "No output buffers provided";
|
LOG(HAL, Error) << "No output buffers provided";
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue