Patch Detail
Show a patch.
GET /api/patches/10156/?format=api
{ "id": 10156, "url": "https://patchwork.libcamera.org/api/patches/10156/?format=api", "web_url": "https://patchwork.libcamera.org/patch/10156/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/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": "<20201021024744.19047-2-laurent.pinchart@ideasonboard.com>", "date": "2020-10-21T02:47:44", "name": "[libcamera-devel,2/2] libcamera: pipeline: simple: Initialize V4L2DeviceFormat before use", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "126a9cba71df6d6b83308ecf07910e1776e65ee8", "submitter": { "id": 2, "url": "https://patchwork.libcamera.org/api/people/2/?format=api", "name": "Laurent Pinchart", "email": "laurent.pinchart@ideasonboard.com" }, "delegate": { "id": 14, "url": "https://patchwork.libcamera.org/api/users/14/?format=api", "username": "pinchartl", "first_name": "Laurent", "last_name": "Pinchart", "email": "laurent.pinchart@ideasonboard.com" }, "mbox": "https://patchwork.libcamera.org/patch/10156/mbox/", "series": [ { "id": 1396, "url": "https://patchwork.libcamera.org/api/series/1396/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1396", "date": "2020-10-21T02:47:43", "name": "[libcamera-devel,1/2] libcamera: v4l2_videodevice: Check plane count when setting format", "version": 1, "mbox": "https://patchwork.libcamera.org/series/1396/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/10156/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/10156/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 8D230BDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 21 Oct 2020 02:48:37 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A15B161DB7;\n\tWed, 21 Oct 2020 04:48:36 +0200 (CEST)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 613A960350\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 21 Oct 2020 04:48:35 +0200 (CEST)", "from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 01077AEE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 21 Oct 2020 04:48:34 +0200 (CEST)" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"pObHvMfc\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1603248515;\n\tbh=ZmOCmYjbtYARu3ABS32YF+DQnaslIvyvVZXrbXRhZQs=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=pObHvMfc6pyAr1M65zMrHLJIowvFcFHrqLUd/vNQyLwifFUCIP1gSu+O6qhR6pYLe\n\tgIXtenK84D90XEl1PUa4RaXTfGerMbUsAUhJRiBkpcgxGkRr6mL7VHY++JhfmzE0bY\n\tohVnj2v2Lwgd/UzRiP78sXcH1TP1kUCpfHJa1DVY=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Wed, 21 Oct 2020 05:47:44 +0300", "Message-Id": "<20201021024744.19047-2-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.27.0", "In-Reply-To": "<20201021024744.19047-1-laurent.pinchart@ideasonboard.com>", "References": "<20201021024744.19047-1-laurent.pinchart@ideasonboard.com>", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [PATCH 2/2] libcamera: pipeline: simple:\n\tInitialize V4L2DeviceFormat before use", "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": "The V4L2DeviceFormat has no default constructor. Zero it before use when\nsetting formats. Failure to do so leaves the planes uninitialized,\npotentially causing memory corruption.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/pipeline/simple/converter.cpp | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)", "diff": "diff --git a/src/libcamera/pipeline/simple/converter.cpp b/src/libcamera/pipeline/simple/converter.cpp\nindex b4ee021f6210..b3705abcd626 100644\n--- a/src/libcamera/pipeline/simple/converter.cpp\n+++ b/src/libcamera/pipeline/simple/converter.cpp\n@@ -72,7 +72,7 @@ std::vector<PixelFormat> SimpleConverter::formats(PixelFormat input)\n \t * Set the format on the input side (V4L2 output) of the converter to\n \t * enumerate the conversion capabilities on its output (V4L2 capture).\n \t */\n-\tV4L2DeviceFormat format;\n+\tV4L2DeviceFormat format = {};\n \tformat.fourcc = m2m_->output()->toV4L2PixelFormat(input);\n \tformat.size = { 1, 1 };\n \n@@ -103,7 +103,7 @@ SizeRange SimpleConverter::sizes(const Size &input)\n \t * Set the size on the input side (V4L2 output) of the converter to\n \t * enumerate the scaling capabilities on its output (V4L2 capture).\n \t */\n-\tV4L2DeviceFormat format;\n+\tV4L2DeviceFormat format = {};\n \tformat.fourcc = V4L2PixelFormat();\n \tformat.size = input;\n \n@@ -142,7 +142,7 @@ SizeRange SimpleConverter::sizes(const Size &input)\n int SimpleConverter::configure(PixelFormat inputFormat, const Size &inputSize,\n \t\t\t StreamConfiguration *cfg)\n {\n-\tV4L2DeviceFormat format;\n+\tV4L2DeviceFormat format = {};\n \tint ret;\n \n \tV4L2PixelFormat videoFormat = m2m_->output()->toV4L2PixelFormat(inputFormat);\n", "prefixes": [ "libcamera-devel", "2/2" ] }