{"id":10529,"url":"https://patchwork.libcamera.org/api/1.1/patches/10529/?format=json","web_url":"https://patchwork.libcamera.org/patch/10529/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20201201161445.64114-1-jacopo@jmondi.org>","date":"2020-12-01T16:14:45","name":"[libcamera-devel] android: camera_device: Check capture_request validity","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"0e559b55161cd8d410edd00942690536d04df13c","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/1.1/people/3/?format=json","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/10529/mbox/","series":[{"id":1497,"url":"https://patchwork.libcamera.org/api/1.1/series/1497/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1497","date":"2020-12-01T16:14:45","name":"[libcamera-devel] android: camera_device: Check capture_request validity","version":1,"mbox":"https://patchwork.libcamera.org/series/1497/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/10529/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/10529/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 46AF4BE177\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  1 Dec 2020 16:14:47 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D913263501;\n\tTue,  1 Dec 2020 17:14:46 +0100 (CET)","from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net\n\t[217.70.183.193])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C806863460\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  1 Dec 2020 17:14:45 +0100 (CET)","from uno.lan (93-34-118-233.ip49.fastwebnet.it [93.34.118.233])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 506B824000D;\n\tTue,  1 Dec 2020 16:14:45 +0000 (UTC)"],"X-Originating-IP":"93.34.118.233","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"hanlinchen@chromium.org,\n\tlibcamera-devel@lists.libcamera.org","Date":"Tue,  1 Dec 2020 17:14:45 +0100","Message-Id":"<20201201161445.64114-1-jacopo@jmondi.org>","X-Mailer":"git-send-email 2.29.1","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH] android: camera_device: Check\n\tcapture_request validity","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Make sure the 'camera3_capture_request_t *' provided to\nCameraDevice::processCaptureRequest() is valid before attempting to\naccess it.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\nThis patch fixes cros_camera_test:\nCamera3FrameTest/Camera3InvalidRequestTest.NullOrUnconfiguredRequest/*\n---\n\n src/android/camera_device.cpp | 5 +++++\n 1 file changed, 5 insertions(+)\n\n--\n2.29.1","diff":"diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\nindex 4eb05df0fdc2..3c8205a095ae 100644\n--- a/src/android/camera_device.cpp\n+++ b/src/android/camera_device.cpp\n@@ -1398,6 +1398,11 @@ FrameBuffer *CameraDevice::createFrameBuffer(const buffer_handle_t camera3buffer\n\n int CameraDevice::processCaptureRequest(camera3_capture_request_t *camera3Request)\n {\n+\tif (!camera3Request) {\n+\t\tLOG(HAL, Error) << \"Invalid capture request\";\n+\t\treturn -EINVAL;\n+\t}\n+\n \tif (!camera3Request->num_output_buffers) {\n \t\tLOG(HAL, Error) << \"No output buffers provided\";\n \t\treturn -EINVAL;\n","prefixes":["libcamera-devel"]}