Show a patch.

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

{
    "id": 18287,
    "url": "https://patchwork.libcamera.org/api/patches/18287/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/18287/",
    "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": "<20230220045523.3884-1-ecurtin@redhat.com>",
    "date": "2023-02-20T04:55:24",
    "name": "[libcamera-devel,v3] cam: file_sink: Fixes following errors with gcc-13",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "300c3ec9346a7af800fc319b8b541d093460eb0d",
    "submitter": {
        "id": 101,
        "url": "https://patchwork.libcamera.org/api/people/101/?format=api",
        "name": "Eric Curtin",
        "email": "ecurtin@redhat.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/18287/mbox/",
    "series": [
        {
            "id": 3758,
            "url": "https://patchwork.libcamera.org/api/series/3758/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3758",
            "date": "2023-02-20T04:55:24",
            "name": "[libcamera-devel,v3] cam: file_sink: Fixes following errors with gcc-13",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/3758/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/18287/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/18287/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 A4AA5BDCBF\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 20 Feb 2023 04:58:17 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B785962605;\n\tMon, 20 Feb 2023 05:58:16 +0100 (CET)",
            "from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.133.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B34DB61EE3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 20 Feb 2023 05:58:13 +0100 (CET)",
            "from mail-wm1-f72.google.com (mail-wm1-f72.google.com\n\t[209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id\n\tus-mta-192-Q0Xcf0daPLWY78kc9XvGYw-1; Sun, 19 Feb 2023 23:58:11 -0500",
            "by mail-wm1-f72.google.com with SMTP id\n\tj7-20020a05600c1c0700b003dc5dd44c0cso56688wms.8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 19 Feb 2023 20:58:10 -0800 (PST)",
            "from p1.. ([94.201.248.122]) by smtp.gmail.com with ESMTPSA id\n\t12-20020a05600c020c00b003dc3f3d77e3sm12900812wmi.7.2023.02.19.20.58.07\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tSun, 19 Feb 2023 20:58:09 -0800 (PST)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1676869096;\n\tbh=rz+vBPGv2sY+xaFwrP7wed7D1St4rOkRoYm0Al1q6Gk=;\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=0KqD+/KjUmJXjiK+icv77Xe2T2uWT70Py+WO1/v2uQRN8ka6/zxgnifWmwu8MJXhy\n\tD7X/bUS2q3K5Fsz/l6n1tiJyEwoUeHqZEKpLfaYKAKEG1E6vfB6J83kLaiV5y9A/s8\n\tmFsBAMEPDkpWUq2gCwXYcQ+sE7ukVjorKsDh5ohrSSfqUYyJz8J7NoVC6uHIGb0WJl\n\tO9VCAejHWFPrzM0Mk91NTs8JdnLzixRtv+0fOi+SbrhD+VRYP3wbVwJyPT+Vu6Q7Ig\n\tqf9HmYYzzZIPCxz1ZlzQ1f+Wtk3kb2GZZfv2MOs01KxCD4emmcd9eIMbxduiMAfuCw\n\tZZRQM4kB+okbg==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1676869092;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tcontent-transfer-encoding:content-transfer-encoding;\n\tbh=P6f4qRJQKx0cJfK+V7sX1xIizszDgS31+8N2Nc2zU0Y=;\n\tb=PiHNqhOuIlzqeNSMw47ia/AVmAa28Osr1BPLXEUd1h66inJPA6uLUtT6qY0qYThuRzDpl0\n\ty/HodvOlNXoP1j6Spj3xZbNsg5cdX+DUFNaUePjoQBQfm7vHo4VSyNS8lZzZMfbglOrlha\n\teeXRWjwiG4003hgyr2E1bAdxbu5atRs="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=redhat.com\n\theader.i=@redhat.com header.b=\"PiHNqhOu\"; \n\tdkim-atps=neutral",
        "X-MC-Unique": "Q0Xcf0daPLWY78kc9XvGYw-1",
        "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=P6f4qRJQKx0cJfK+V7sX1xIizszDgS31+8N2Nc2zU0Y=;\n\tb=PUFr1O0JkHha3nyituseDwBdX605dZ5QaWqYIHUcyj3yMmZubVep7FjImF0LPIR2Bt\n\tgEDAHifWsAk6DH4IeiMN9jaRHUIkg/3icdpI1aTz6LyFNVSOSmikhhAKfazluOTKmf73\n\tXz6p1M63JRwvkIXxDdOrt0VeTOIrj2bGna6s6EIUWtZA/LRuRX8KAURab6f1+fQQnYxF\n\t/QMoHsN8DHdIAdCuv1qq2GVxIh2rXrtXEesbw8SiyN6Js2/CNa545kYTsi8p27fR29zL\n\tD3+O6iLyIZpuR/+t6oys/hEyIhJ9vh7QSwG9xyWc0WYJAFUzktfmRM10C60OigN+kesp\n\tKHGg==",
        "X-Gm-Message-State": "AO0yUKX/bmgPJ4h7husYVw9/zek72mAbEjO9nzxBA8kyCPz8qahhmFRM\n\tUHux9iH6uNeBPV0+t1bFoPQsr74L530+5vG8joX8HUygUGW/iadXxcsdg13zipKpwtMm/a3Sxcj\n\tmZQXhOq5oliBRj0UPeVpM8Q7xj31AauT9mcz1n4aaHIpLs3NevJs4IoL+VniGJMV6VJUCx3upsy\n\tNS8BMNlHWIK+QCKkXj",
        "X-Received": [
            "by 2002:a05:600c:2ed2:b0:3e0:e77:3056 with SMTP id\n\tq18-20020a05600c2ed200b003e00e773056mr5211930wmn.30.1676869089764; \n\tSun, 19 Feb 2023 20:58:09 -0800 (PST)",
            "by 2002:a05:600c:2ed2:b0:3e0:e77:3056 with SMTP id\n\tq18-20020a05600c2ed200b003e00e773056mr5211913wmn.30.1676869089390; \n\tSun, 19 Feb 2023 20:58:09 -0800 (PST)"
        ],
        "X-Google-Smtp-Source": "AK7set9EIsOrDswotPufTeyjOOdKmhOAJQ5SUl3Y9wVweAEp0/qXSGCJ+cwfLrBewCDaIM7LWn8oNQ==",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Mon, 20 Feb 2023 04:55:24 +0000",
        "Message-Id": "<20230220045523.3884-1-ecurtin@redhat.com>",
        "X-Mailer": "git-send-email 2.39.1",
        "MIME-Version": "1.0",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-Originator": "redhat.com",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain; charset=\"US-ASCII\"; x-default=true",
        "Subject": "[libcamera-devel] [PATCH v3] cam: file_sink: Fixes following errors\n\twith gcc-13",
        "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": "Eric Curtin via libcamera-devel <libcamera-devel@lists.libcamera.org>",
        "Reply-To": "Eric Curtin <ecurtin@redhat.com>",
        "Cc": "Khem Raj <raj.khem@gmail.com>, wtaymans@redhat.com",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "../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\nCo-developed-by: Khem Raj <raj.khem@gmail.com>\nSigned-off-by: Eric Curtin <ecurtin@redhat.com>\n---\nChanges in v3:\n\n- Added comment explaining change made because of false negative in gcc\n\nChanges in v2:\n\n- Added const\n- Made patch mergeable by accounting for new directory structure\n---\n src/apps/cam/file_sink.cpp | 14 +++++++++-----\n 1 file changed, 9 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/src/apps/cam/file_sink.cpp b/src/apps/cam/file_sink.cpp\nindex b32aad24..01846cdb 100644\n--- a/src/apps/cam/file_sink.cpp\n+++ b/src/apps/cam/file_sink.cpp\n@@ -114,13 +114,17 @@ 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-\n+\t\t/*\n+\t\t * formerly \"const FrameMetadata::Plane &\" \n+\t\t * causing false negative (gcc 13):\n+\t\t * \"possibly dangling reference to a temporary\"\n+\t\t */\n+\t\tconst unsigned int bytesused = buffer->metadata().planes()[i].bytesused;\n \t\tSpan<uint8_t> data = image->data(i);\n-\t\tunsigned int length = std::min<unsigned int>(meta.bytesused, data.size());\n+\t\tconst unsigned 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",
        "v3"
    ]
}