Show a patch.

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

{
    "id": 10155,
    "url": "https://patchwork.libcamera.org/api/patches/10155/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/10155/",
    "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-1-laurent.pinchart@ideasonboard.com>",
    "date": "2020-10-21T02:47:43",
    "name": "[libcamera-devel,1/2] libcamera: v4l2_videodevice: Check plane count when setting format",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "615f9473c8d7bcd9caeeca38b34614ad2e08a2db",
    "submitter": {
        "id": 2,
        "url": "https://patchwork.libcamera.org/api/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/10155/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/10155/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/10155/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 C98CEBDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 21 Oct 2020 02:48:36 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5310661DA6;\n\tWed, 21 Oct 2020 04:48:36 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1EB1760350\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 A2C6C92\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=\"JL0DpJRn\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1603248514;\n\tbh=bZbgIcwVG2Enir7oSzr6vgHMDyO0BR75+hlNr+iWWv4=;\n\th=From:To:Subject:Date:From;\n\tb=JL0DpJRnyHMZ6t/MZezMh7K1pzlP5Fy1DHMsppliQ3ZNDfEeGQfrtQCzEM/4k/14y\n\tFi8RMuBp8574iYKnoJQG5E2bZzXpkcrYTNBsGw6oEpWkntQiWfmdmtZ6+x204tFmXF\n\tdTAQFIFsH8X5vmduEu193r66lMkux5sptN8Epedc=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed, 21 Oct 2020 05:47:43 +0300",
        "Message-Id": "<20201021024744.19047-1-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.27.0",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH 1/2] 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=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "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>\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 16162e1edba3..3ba9e5ba134a 100644\n--- a/src/libcamera/v4l2_videodevice.cpp\n+++ b/src/libcamera/v4l2_videodevice.cpp\n@@ -861,6 +861,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",
        "1/2"
    ]
}