[{"id":2665,"web_url":"https://patchwork.libcamera.org/comment/2665/","msgid":"<20190916202527.j42r7uwcoipygxig@uno.localdomain>","date":"2019-09-16T20:25:27","subject":"Re: [libcamera-devel] [PATCH] test: buffer_import: Initialize\n\tmedia_ and video_","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Pushed with an updated commit message too\n\"test: buffer_import: Initialize video_ to nullptr\"\n\nOn Mon, Sep 16, 2019 at 10:18:59PM +0200, Jacopo Mondi wrote:\n> When the vivid module used to test buffer importing is not loaded, the\n> test correctly bails out, but during the clean up procedure tries to\n> access the video_ fields, which, if not correctly initialized to\n> nullptr, contains random values and accessing it cause a segfault.\n>\n> Fix this by initializing video_ field to nullptr to make sure it is\n> properly handled in cleanup().\n>\n> Fixes: e1a5873701a9 (\"test: camera: Add buffer import and mapping test\")\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> ---\n>  test/camera/buffer_import.cpp | 5 +++++\n>  1 file changed, 5 insertions(+)\n>\n> diff --git a/test/camera/buffer_import.cpp b/test/camera/buffer_import.cpp\n> index 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> --\n> 2.23.0\n>\n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<jacopo@jmondi.org>","Received":["from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net\n\t[217.70.183.196])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 374E360BED\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 16 Sep 2019 22:23:51 +0200 (CEST)","from uno.localdomain (bl10-204-24.dsl.telepac.pt [85.243.204.24])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay4-d.mail.gandi.net (Postfix) with ESMTPSA id BDED3E0002\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 16 Sep 2019 20:23:50 +0000 (UTC)"],"X-Originating-IP":"85.243.204.24","Date":"Mon, 16 Sep 2019 22:25:27 +0200","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190916202527.j42r7uwcoipygxig@uno.localdomain>","References":"<20190916201859.26553-1-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\"; boundary=\"hy5zqaxr55ceqsch\"","Content-Disposition":"inline","In-Reply-To":"<20190916201859.26553-1-jacopo@jmondi.org>","User-Agent":"NeoMutt/20180716","Subject":"Re: [libcamera-devel] [PATCH] test: buffer_import: Initialize\n\tmedia_ and 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:23:51 -0000"}}]