{"id":10015,"url":"https://patchwork.libcamera.org/api/1.1/patches/10015/?format=json","web_url":"https://patchwork.libcamera.org/patch/10015/","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":"<20201007131812.2688973-4-tomi.valkeinen@iki.fi>","date":"2020-10-07T13:18:12","name":"[libcamera-devel,v2,3/3] ipa: raspberrypi: fix missing initialize of status_","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"f3e24cef5d106cef3c9176e394c2d804194e3f93","submitter":{"id":70,"url":"https://patchwork.libcamera.org/api/1.1/people/70/?format=json","name":"Tomi Valkeinen","email":"tomi.valkeinen@iki.fi"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/10015/mbox/","series":[{"id":1364,"url":"https://patchwork.libcamera.org/api/1.1/series/1364/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1364","date":"2020-10-07T13:18:09","name":"ipa: raspberrypi: fix uninit variables","version":2,"mbox":"https://patchwork.libcamera.org/series/1364/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/10015/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/10015/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 D311BBEEE0\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  7 Oct 2020 13:18:31 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A2435605BD;\n\tWed,  7 Oct 2020 15:18:31 +0200 (CEST)","from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com\n\t[IPv6:2a00:1450:4864:20::22a])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A29FA605C1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  7 Oct 2020 15:18:29 +0200 (CEST)","by mail-lj1-x22a.google.com with SMTP id a5so1920430ljj.11\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 07 Oct 2020 06:18:29 -0700 (PDT)","from deskari.lan (91-152-83-50.elisa-laajakaista.fi.\n\t[91.152.83.50]) by smtp.gmail.com with ESMTPSA id\n\ti139sm329539lfi.276.2020.10.07.06.18.28\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 07 Oct 2020 06:18:28 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"nUHT/lL9\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=sender:from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=Op4MknI1SgUbicnV8hX1MgQiNFJB/6qJmdYNwp8arEk=;\n\tb=nUHT/lL9EOjKiQj2Pw35xBx4/FTkHCWj8/1w9pUSWMYyMwSP0FN0yIceKGCpisnE86\n\tsZ3ptdrMidG3DQJsKrt5VTMwI8Xr5T8+LrP09PXnSqhyrb/UUZLqTGlAyOZ59h3Pjq+G\n\tTHpHxk0XmKasO57W0dU9M0obLCLP3rwswnpVpJzgsJ7oY6hSq5BFAjHr0MT6tk/rcy3w\n\t5ucDwu0UzWmCOuP4T/1a/HxYIlt7WdHhbA+MuGtwyq2+IkAKsvn9ulKpolBMnoKQfXum\n\tlwtqDxJ+BeXKbADMhW/3i4fvqLkR6JMe6SFpqx5q2mLBR+4IOUEsDSJ9rkF5mm3WBqYR\n\tQ51w==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:sender:from:to:cc:subject:date:message-id\n\t:in-reply-to:references:mime-version:content-transfer-encoding;\n\tbh=Op4MknI1SgUbicnV8hX1MgQiNFJB/6qJmdYNwp8arEk=;\n\tb=U4Vp5Ojfn5zx1sZP7ZJ8zllzh/s8DuY1QZpm5ndRy3sHJgLXkQqgfwgB5ckKNi3gUC\n\tUte030RCTE9b6sVXf2uR+ZFe3ZbPqSvmy/arDm/gtxnpiSIihj3uhvj6cfUq9Q2zZCA6\n\tRIQ0eRVclxVrP0fYbpVpChQVPaGUvwmU0zmv2RkMBWedkihtt/gI56nLF4oqmOZcI5a4\n\tcX0QQEkeTbILMLvd7AFbKZlqZSpYYw+sH3LV1eLAC130CQQQc7KtuYRDa3/erG9yrgzk\n\tQpMtKSDQzeCV89QhW2inMVgK2KHhJwpqUGRKxqaOr9TSyk5mp9mubN5ltdZB/3GyrVGZ\n\tfzvQ==","X-Gm-Message-State":"AOAM532MaKBWQxDeuNhx486z+Zo/GJooTVBVyGcZeuqenG0Iis0nvWz7\n\tB7a2vPJs/nqeeD69bh2+HDQglcCjpQXk0g==","X-Google-Smtp-Source":"ABdhPJz7Y/HYo8t1xscqcHgMCnrlzMHuD88ifhRxnwR3ijIFTM6nhIlHtnQmqc44bEi5T4jO1JuzUg==","X-Received":"by 2002:a05:651c:141:: with SMTP id\n\tc1mr1279566ljd.182.1602076708947; \n\tWed, 07 Oct 2020 06:18:28 -0700 (PDT)","From":"Tomi Valkeinen <tomi.valkeinen@iki.fi>","To":"libcamera-devel@lists.libcamera.org,\n\tNaushir Patuck <naush@raspberrypi.com>,\n\tDavid Plowman <david.plowman@raspberrypi.com>","Date":"Wed,  7 Oct 2020 16:18:12 +0300","Message-Id":"<20201007131812.2688973-4-tomi.valkeinen@iki.fi>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20201007131812.2688973-1-tomi.valkeinen@iki.fi>","References":"<20201007131812.2688973-1-tomi.valkeinen@iki.fi>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH v2 3/3] ipa: raspberrypi: fix missing\n\tinitialize of status_","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>","Cc":"Tomi Valkeinen <tomi.valkeinen@iki.fi>","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":"Many fields in status_ are not initialized, causing use of uninitialized\nmemory.\n\nDrop the code that clears some of the individual fields, and instead\njust memset the whole thing.\n\nSigned-off-by: Tomi Valkeinen <tomi.valkeinen@iki.fi>\n---\n src/ipa/raspberrypi/controller/rpi/agc.cpp | 16 ++++++++--------\n 1 file changed, 8 insertions(+), 8 deletions(-)","diff":"diff --git a/src/ipa/raspberrypi/controller/rpi/agc.cpp b/src/ipa/raspberrypi/controller/rpi/agc.cpp\nindex df4d364..6ae774d 100644\n--- a/src/ipa/raspberrypi/controller/rpi/agc.cpp\n+++ b/src/ipa/raspberrypi/controller/rpi/agc.cpp\n@@ -148,14 +148,14 @@ Agc::Agc(Controller *controller)\n \t  exposure_mode_(nullptr), constraint_mode_(nullptr),\n \t  frame_count_(0), lock_count_(0)\n {\n-\tev_ = status_.ev = 1.0;\n-\tflicker_period_ = status_.flicker_period = 0.0;\n-\tfixed_shutter_ = status_.fixed_shutter = 0;\n-\tfixed_analogue_gain_ = status_.fixed_analogue_gain = 0.0;\n-\t// set to zero initially, so we can tell it's not been calculated\n-\tstatus_.total_exposure_value = 0.0;\n-\tstatus_.target_exposure_value = 0.0;\n-\tstatus_.locked = false;\n+\tmemset(&status_, 0, sizeof(status_));\n+\tstatus_.ev = 1.0;\n+\n+\tev_ = status_.ev;\n+\tflicker_period_ = status_.flicker_period;\n+\tfixed_shutter_ = status_.fixed_shutter;\n+\tfixed_analogue_gain_ = status_.fixed_analogue_gain;\n+\n \toutput_status_ = status_;\n }\n \n","prefixes":["libcamera-devel","v2","3/3"]}