Show a patch.

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

{
    "id": 18192,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/18192/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/18192/",
    "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": "<20230124193733.3153431-1-raj.khem@gmail.com>",
    "date": "2023-01-24T19:37:33",
    "name": "[libcamera-devel,v2] file_sink.cpp: Avoid dangling-reference",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "ee9a8152466c1b9166af56af07c196a96d4bf089",
    "submitter": {
        "id": 62,
        "url": "https://patchwork.libcamera.org/api/1.1/people/62/?format=api",
        "name": "Khem Raj",
        "email": "raj.khem@gmail.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/18192/mbox/",
    "series": [
        {
            "id": 3722,
            "url": "https://patchwork.libcamera.org/api/1.1/series/3722/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3722",
            "date": "2023-01-24T19:37:33",
            "name": "[libcamera-devel,v2] file_sink.cpp: Avoid dangling-reference",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/3722/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/18192/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/18192/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 CB0C0BEFBE\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 24 Jan 2023 19:37:40 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 25EB4625E4;\n\tTue, 24 Jan 2023 20:37:40 +0100 (CET)",
            "from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com\n\t[IPv6:2607:f8b0:4864:20::1034])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id EFE10603D8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 24 Jan 2023 20:37:38 +0100 (CET)",
            "by mail-pj1-x1034.google.com with SMTP id\n\th5-20020a17090a9c0500b0022bb85eb35dso10653248pjp.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 24 Jan 2023 11:37:38 -0800 (PST)",
            "from apollo.hsd1.ca.comcast.net ([2601:646:9181:1cf0::aee3])\n\tby smtp.gmail.com with ESMTPSA id\n\ta23-20020a1709027d9700b00187033cac81sm2033203plm.145.2023.01.24.11.37.35\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 24 Jan 2023 11:37:36 -0800 (PST)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1674589060;\n\tbh=6wOaJB2Bm7f7VAoR0zup9Hpsic4xEg1BGQRbJTjn2XQ=;\n\th=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:\n\tList-Help:List-Subscribe:From:Reply-To:Cc:From;\n\tb=ZsWRXtzEjey6kCPEltmP99KKtUdY/WvYwxpX90IGrcjnJ8L2n3twgsoOGMCr1A/kh\n\ttLioDf/JJh7phW5KPng3mKwITUsJVzyN+T2XWe1n7tyfd+q8xWoKPiTJoVUD/r9J7h\n\tzQXZbLp1Pufyq7TKo+omfVB2MXIo3G+VHRJ42QDpkjWEioLVrakB4ULlEcEnzQW+LC\n\tpJdjV/kEfqxgEgkksdQAwGw2z5NE6baYcJfE5yEFnaZ0f5fQgxuVjAxEXeUqQHRQLW\n\tAofWR2kteKZf3lrlRzq4oGZSMtSfP1ZCQRHxEUMVypB1DzrlEOlofsMdnLnBLp2XyV\n\th/rspmuQ76QsQ==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;\n\th=content-transfer-encoding:mime-version:message-id:date:subject:cc\n\t:to:from:from:to:cc:subject:date:message-id:reply-to;\n\tbh=XYObCYTp7zgHbjmCw+6WCGL8Of5FyJc3TV0T19ps01U=;\n\tb=G+vIghnp7n4wgE+lwLPPOt8mLX1dNJUOicm2HJmWW5aalzLxGiHNRrZor3UXlLHxot\n\tOLii/RAaXx9NH68lTSkyFuaqfyqj/qcsDmRL+vXPBpQKeUFcJDTXwvyK1uqFDsor/5L/\n\tW0P1/1ceD5Dm444qIjOa5s4ZUjJHJiScWm9pmN6Nj1eza5/KN5ryo7Md1lKu+31fKYJc\n\tCCBhThf/C+c6ZyfPv+wqZECIt4jJtGfpNZ6Re/WO7DiaHJbmo6lqs4MZt4Ck1LXy0twO\n\tCaS53N5CSfzUxx0OZDrPkIBJblX0Y2Yp8+MymYuL3ObxpRcURs+pDYwgvjwtgBVTX4PV\n\twILA=="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"G+vIghnp\"; dkim-atps=neutral",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=content-transfer-encoding:mime-version:message-id:date:subject:cc\n\t:to:from:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=XYObCYTp7zgHbjmCw+6WCGL8Of5FyJc3TV0T19ps01U=;\n\tb=RJt22xeItVP1ySyg0oAcFpA7FPHJKnmfc2T2WY1UzhewYYbxx2BKR0nVD9/WGFG9Ki\n\tFRuPpjsOXcBv1vJn+0mb/4nM10jTVpnjDtfFfuD2PyW82GmtFoCId4EFILNP/j/JJ4aR\n\tbk6ayuxxC9MTpDNe80Fu1X9JEfv1DGLp/UaPHf+0bajzZgJm95uR3v3PlyWQIgl3bxtc\n\thXwnNjGSD1RMbBUvYmPuMPUTsUEtSqcse9gp3PgF17nc76BQY4UQUPJBmmq8T+YKXPfj\n\tyaRkzseV64DdPOtlBE7S0qr0aq7kVkouxpfMd7QQaRnblCdtfeHAna37thjtiqxNUU6t\n\tiH8A==",
        "X-Gm-Message-State": "AFqh2kpkJ8X9IxbY9LGSv4jJwHjJULT+6sUjx24HQV3YtA5/2YMS1Z52\n\tLzzL0zly6ixr7NVNUXNxjc1Uskv9aMQNJw==",
        "X-Google-Smtp-Source": "AMrXdXsg5IY5/XumTLea1MuAzZQqdO+GobtTw4AK1vyN4cn9IyoOGntTCR5lrH8SOeedFPTxDTTsfQ==",
        "X-Received": "by 2002:a17:902:6b4b:b0:194:a1f6:65b6 with SMTP id\n\tg11-20020a1709026b4b00b00194a1f665b6mr32162347plt.41.1674589056669; \n\tTue, 24 Jan 2023 11:37:36 -0800 (PST)",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Tue, 24 Jan 2023 11:37:33 -0800",
        "Message-Id": "<20230124193733.3153431-1-raj.khem@gmail.com>",
        "X-Mailer": "git-send-email 2.39.1",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v2] file_sink.cpp: Avoid dangling-reference",
        "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>",
        "From": "Khem Raj via libcamera-devel <libcamera-devel@lists.libcamera.org>",
        "Reply-To": "Khem Raj <raj.khem@gmail.com>",
        "Cc": "Khem Raj <raj.khem@gmail.com>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Fixes following errors with gcc-13\n\n../git/src/cam/file_sink.cpp:92:45: error: possibly dangling reference to a temporary [-Werror=dangling-reference]\n   92 |                 const FrameMetadata::Plane &meta = buffer->metadata().planes()[i];\n      |                                             ^~~~\n../git/src/cam/file_sink.cpp:92:81: note: the temporary was destroyed at the end of the full expression '(& buffer->libcamera::FrameBuffer::metadata())->libcamera::FrameMetadata::planes().libcamera::Span<const libcamera::FrameMetadata::Plane>::operator[](i)'\n   92 |                 const FrameMetadata::Plane &meta = buffer->metadata().planes()[i];\n      |                                                                                 ^\ncc1plus: all warnings being treated as errors\n\nUpstream-Status: Submitted [https://lists.libcamera.org/pipermail/libcamera-devel/2023-January/036575.html]\nSigned-off-by: Khem Raj <raj.khem@gmail.com>\n---\nv2: Rebase on tip of trunk\n\n src/apps/cam/file_sink.cpp | 8 ++++----\n 1 file changed, 4 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/src/apps/cam/file_sink.cpp b/src/apps/cam/file_sink.cpp\nindex b32aad24..9f4c5648 100644\n--- a/src/apps/cam/file_sink.cpp\n+++ b/src/apps/cam/file_sink.cpp\n@@ -114,13 +114,13 @@ void FileSink::writeBuffer(const Stream *stream, FrameBuffer *buffer,\n \t}\n \n \tfor (unsigned int i = 0; i < buffer->planes().size(); ++i) {\n-\t\tconst FrameMetadata::Plane &meta = buffer->metadata().planes()[i];\n+\t\tunsigned int bytesused = buffer->metadata().planes()[i].bytesused;\n \n \t\tSpan<uint8_t> data = image->data(i);\n-\t\tunsigned int length = std::min<unsigned int>(meta.bytesused, data.size());\n+\t\tunsigned int length = std::min<unsigned int>(bytesused, data.size());\n \n-\t\tif (meta.bytesused > data.size())\n-\t\t\tstd::cerr << \"payload size \" << meta.bytesused\n+\t\tif (bytesused > data.size())\n+\t\t\tstd::cerr << \"payload size \" << bytesused\n \t\t\t\t  << \" larger than plane size \" << data.size()\n \t\t\t\t  << std::endl;\n \n",
    "prefixes": [
        "libcamera-devel",
        "v2"
    ]
}