{"id":1977,"url":"https://patchwork.libcamera.org/api/1.1/patches/1977/?format=json","web_url":"https://patchwork.libcamera.org/patch/1977/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20190916201859.26553-1-jacopo@jmondi.org>","date":"2019-09-16T20:18:59","name":"[libcamera-devel] test: buffer_import: Initialize media_ and video_","commit_ref":"0f2e8cac8dd43544adad50bf42b0fda496ddb055","pull_url":null,"state":"accepted","archived":false,"hash":"6ea09817c8bfe73fb4c1a3c78ca0a86f60cf398f","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/1.1/people/3/?format=json","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/1977/mbox/","series":[{"id":499,"url":"https://patchwork.libcamera.org/api/1.1/series/499/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=499","date":"2019-09-16T20:18:59","name":"[libcamera-devel] test: buffer_import: Initialize media_ and video_","version":1,"mbox":"https://patchwork.libcamera.org/series/499/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/1977/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/1977/checks/","tags":{},"headers":{"Return-Path":"<jacopo@jmondi.org>","Received":["from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net\n\t[217.70.183.193])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6B78F60BE6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 16 Sep 2019 22:17:28 +0200 (CEST)","from uno.lan (bl10-204-24.dsl.telepac.pt [85.243.204.24])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay1-d.mail.gandi.net (Postfix) with ESMTPSA id DCACC24000A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 16 Sep 2019 20:17:27 +0000 (UTC)"],"X-Originating-IP":"85.243.204.24","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Mon, 16 Sep 2019 22:18:59 +0200","Message-Id":"<20190916201859.26553-1-jacopo@jmondi.org>","X-Mailer":"git-send-email 2.23.0","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH] test: buffer_import: Initialize media_\n\tand video_","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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>","X-List-Received-Date":"Mon, 16 Sep 2019 20:17:28 -0000"},"content":"When the vivid module used to test buffer importing is not loaded, the\ntest correctly bails out, but during the clean up procedure tries to\naccess the video_ fields, which, if not correctly initialized to\nnullptr, contains random values and accessing it cause a segfault.\n\nFix this by initializing video_ field to nullptr to make sure it is\nproperly handled in cleanup().\n\nFixes: e1a5873701a9 (\"test: camera: Add buffer import and mapping test\")\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n test/camera/buffer_import.cpp | 5 +++++\n 1 file changed, 5 insertions(+)\n\n--\n2.23.0","diff":"diff --git a/test/camera/buffer_import.cpp b/test/camera/buffer_import.cpp\nindex 9364e3d1bc44..9cac19d8ce81 100644\n--- a/test/camera/buffer_import.cpp\n+++ b/test/camera/buffer_import.cpp\n@@ -28,6 +28,11 @@ static constexpr unsigned int CAMERA_BUFFER_COUNT = 4;\n class FrameSink\n {\n public:\n+\tFrameSink()\n+\t\t: video_(nullptr)\n+\t{\n+\t}\n+\n \tint init()\n \t{\n \t\tint ret;\n","prefixes":["libcamera-devel"]}