Patch Detail
Show a patch.
GET /api/1.1/patches/1715/?format=api
{ "id": 1715, "url": "https://patchwork.libcamera.org/api/1.1/patches/1715/?format=api", "web_url": "https://patchwork.libcamera.org/patch/1715/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20190718042754.26535-1-kieran.bingham@ideasonboard.com>", "date": "2019-07-18T04:27:54", "name": "[libcamera-devel] libcamera: camera: Fail to configure on mis-configured streams", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "4ede6723137387992342e2f46247a1cf1b242002", "submitter": { "id": 4, "url": "https://patchwork.libcamera.org/api/1.1/people/4/?format=api", "name": "Kieran Bingham", "email": "kieran.bingham@ideasonboard.com" }, "delegate": { "id": 11, "url": "https://patchwork.libcamera.org/api/1.1/users/11/?format=api", "username": "kbingham", "first_name": "Kieran", "last_name": "Bingham", "email": "kieran.bingham@ideasonboard.com" }, "mbox": "https://patchwork.libcamera.org/patch/1715/mbox/", "series": [ { "id": 438, "url": "https://patchwork.libcamera.org/api/1.1/series/438/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=438", "date": "2019-07-18T04:27:54", "name": "[libcamera-devel] libcamera: camera: Fail to configure on mis-configured streams", "version": 1, "mbox": "https://patchwork.libcamera.org/series/438/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/1715/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/1715/checks/", "tags": {}, "headers": { "Return-Path": "<kieran.bingham@ideasonboard.com>", "Received": [ "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6E01160C00\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 18 Jul 2019 06:27:59 +0200 (CEST)", "from localhost.localdomain\n\t(cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id D84AE31C;\n\tThu, 18 Jul 2019 06:27:58 +0200 (CEST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1563424079;\n\tbh=VgpNqd0uoDVg/dMV53qz4/lCObiaydJrZg1Ub8LHIbQ=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=W0ZYW3ilRcUL8RHctImvd4RAOmfFoYnU06799tawZnwL2lf112VjctXq7+tsKgz9k\n\trfkygKs4aIRkJD/De7BoBnxx9y9Xk0OUvb4pTqc5JnTS/Uutjgk4tFuFHptZqCfHY3\n\tV9AywrGmITqZsRYGGaAkSa/igFJXrWXc0yS2VTjs=", "From": "Kieran Bingham <kieran.bingham@ideasonboard.com>", "To": "LibCamera Devel <libcamera-devel@lists.libcamera.org>", "Date": "Thu, 18 Jul 2019 05:27:54 +0100", "Message-Id": "<20190718042754.26535-1-kieran.bingham@ideasonboard.com>", "X-Mailer": "git-send-email 2.20.1", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH] libcamera: camera: Fail to configure on\n\tmis-configured streams", "X-BeenThere": "libcamera-devel@lists.libcamera.org", "X-Mailman-Version": "2.1.23", "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>", "X-List-Received-Date": "Thu, 18 Jul 2019 04:27:59 -0000" }, "content": "Uses of LOG(x, Fatal) and ASSERT() should be capable of continuing\nwithout crashing.\n\nCamera::configure() validates that each StreamConfiguration has a\nStream* and reports a Fatal error otherwise. The code then goes on to\ndereference the Stream pointer which will be a nullptr in the event of\nthe Fatal error being triggered.\n\nIn release builds, ASSERTS are compiled out, and LOG(x, Fatal) should\nattempt to continue or report the error up the call-stack.\n\nMake Camera::configure() return an error in the event that the Stream*\nis not valid. This will cause the configure operation to fail and the\napplication will be notified just as other errors in the\nCamera::configure() operation do.\n\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n src/libcamera/camera.cpp | 4 +++-\n 1 file changed, 3 insertions(+), 1 deletion(-)", "diff": "diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp\nindex 76c737cb9381..7ad9e0e48686 100644\n--- a/src/libcamera/camera.cpp\n+++ b/src/libcamera/camera.cpp\n@@ -672,9 +672,11 @@ int Camera::configure(CameraConfiguration *config)\n \tactiveStreams_.clear();\n \tfor (const StreamConfiguration &cfg : *config) {\n \t\tStream *stream = cfg.stream();\n-\t\tif (!stream)\n+\t\tif (!stream) {\n \t\t\tLOG(Camera, Fatal)\n \t\t\t\t<< \"Pipeline handler failed to update stream configuration\";\n+\t\t\treturn -EINVAL;\n+\t\t}\n \n \t\tstream->configuration_ = cfg;\n \t\tactiveStreams_.insert(stream);\n", "prefixes": [ "libcamera-devel" ] }