Show a patch.

GET /api/1.1/patches/10332/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 10332,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/10332/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/10332/",
    "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": "<20201104074841.21676-3-laurent.pinchart@ideasonboard.com>",
    "date": "2020-11-04T07:48:40",
    "name": "[libcamera-devel,v2,2/3] libcamera: v4l2_videodevice: Check plane count when setting format",
    "commit_ref": "e9463449049c78b6b1c61410082a5339338b2e81",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "615f9473c8d7bcd9caeeca38b34614ad2e08a2db",
    "submitter": {
        "id": 2,
        "url": "https://patchwork.libcamera.org/api/1.1/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/10332/mbox/",
    "series": [
        {
            "id": 1443,
            "url": "https://patchwork.libcamera.org/api/1.1/series/1443/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1443",
            "date": "2020-11-04T07:48:38",
            "name": "libcamera: Fix uninitialized use of V4L2DeviceFormat members",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/1443/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/10332/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/10332/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 ABF40BE081\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  4 Nov 2020 07:49:36 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 69E2062C81;\n\tWed,  4 Nov 2020 08:49:35 +0100 (CET)",
            "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 05F1060344\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  4 Nov 2020 08:49:34 +0100 (CET)",
            "from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 9A115563\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  4 Nov 2020 08:49:33 +0100 (CET)"
        ],
        "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=\"d2CMbr4U\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1604476173;\n\tbh=zCiPuyjQJ5xYMd/bWE5br2qVmIl/8gyav1Gsv9wkT04=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=d2CMbr4UPUbQda15Tr6Aram8L6FH6SarEqC/pdHMHVjPdQI2mZnSIVfOWuwLaq7DX\n\tVZKEAV22E7Cd3ZZfrE8UUkAc0svyeJlxhBKYURgq/X8/UbQDJ0MYs5stcpn89xBNJk\n\t3bogYYgsyC2YMtfCyligJoTgS+9ngVfzTcHtsxak=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed,  4 Nov 2020 09:48:40 +0200",
        "Message-Id": "<20201104074841.21676-3-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.27.0",
        "In-Reply-To": "<20201104074841.21676-1-laurent.pinchart@ideasonboard.com>",
        "References": "<20201104074841.21676-1-laurent.pinchart@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH v2 2/3] libcamera: v4l2_videodevice: Check\n\tplane count when setting format",
        "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=\"utf-8\"",
        "Content-Transfer-Encoding": "base64",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "When setting (or trying) a format with a multiplanar device, the\nV4L2VideoDevice::trySetFormatMeta() function iterates over all planes\navailable in the V4L2DeviceFormat structure. The caller is responsible\nfor setting the plane count, and failure to do so properly may result in\nmemory corruption. This can lead to a crash way after the function\nreturns, making the problem difficult to debug.\n\nAs the issue is caused by a bug in the caller, use an assertion to catch\nit.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n src/libcamera/v4l2_videodevice.cpp | 2 ++\n 1 file changed, 2 insertions(+)",
    "diff": "diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\nindex d07c3530eea5..ac3c8c7dd97a 100644\n--- a/src/libcamera/v4l2_videodevice.cpp\n+++ b/src/libcamera/v4l2_videodevice.cpp\n@@ -870,6 +870,8 @@ int V4L2VideoDevice::trySetFormatMultiplane(V4L2DeviceFormat *format, bool set)\n \tpix->num_planes = format->planesCount;\n \tpix->field = V4L2_FIELD_NONE;\n \n+\tASSERT(pix->num_planes <= ARRAY_SIZE(pix->plane_fmt));\n+\n \tfor (unsigned int i = 0; i < pix->num_planes; ++i) {\n \t\tpix->plane_fmt[i].bytesperline = format->planes[i].bpl;\n \t\tpix->plane_fmt[i].sizeimage = format->planes[i].size;\n",
    "prefixes": [
        "libcamera-devel",
        "v2",
        "2/3"
    ]
}