{"id":10016,"url":"https://patchwork.libcamera.org/api/1.1/patches/10016/?format=json","web_url":"https://patchwork.libcamera.org/patch/10016/","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-3-tomi.valkeinen@iki.fi>","date":"2020-10-07T13:18:11","name":"[libcamera-devel,v2,2/3] ipa: raspberrypi: fix access to uninitialized variables","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"17aab4484b61bfd18503d95eda14b2bbdd76d50d","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/10016/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/10016/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/10016/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 4F39EBEEE0\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  7 Oct 2020 13:18:32 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 03BF6605C7;\n\tWed,  7 Oct 2020 15:18:32 +0200 (CEST)","from mail-lf1-x142.google.com (mail-lf1-x142.google.com\n\t[IPv6:2a00:1450:4864:20::142])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5ECEC605C1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  7 Oct 2020 15:18:30 +0200 (CEST)","by mail-lf1-x142.google.com with SMTP id a9so2240054lfc.7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 07 Oct 2020 06:18:30 -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.27\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 07 Oct 2020 06:18:27 -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=\"N/lcLhPC\"; 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=DV8vcqf/qgNOAuvGzM1EorYjKQ/K1c2uv/hvw8RyPIc=;\n\tb=N/lcLhPCL8gphSIoGKCI9WHk/dodyklktKCZP3J8wCPsiYJIhbrB0JHQG6QX1AJB2Y\n\t5Rzk01Hie930ImTXi5vA504Adp1lNMUYltsIpgNdD9Ib59YEGATq34maONGGzt9U46yD\n\t7secXuilzS5B1kSifTr+3/+YSkhndIu+WBSITyf25Ln82/gSbYbMIU99rsJn8BnsSr+n\n\tRGdLa2YNuAm+87si2ax95OdD6WlmLOcZ3ibubGLwoH5Op2PwtMfulOmOPtvYjzJacJD1\n\tFEvidgw1Adfc5Xgd4XWgH5JpSkDeZZtREM5XfLQWndvZmslXx42QSS83tpbWw4f08vhk\n\ts4KQ==","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=DV8vcqf/qgNOAuvGzM1EorYjKQ/K1c2uv/hvw8RyPIc=;\n\tb=Mi+IawAGuu+DdAkkl/udARBJ+6qGFP8hkaKgSwXLOuBvtcj/eU+zE4HRb8JMBGj3j2\n\tMG+ze452UeJzr7DmI2ynYYQqGDRpVh9mXAuBDPkFE7rHyLLY7Pfz7iSOLufCNRuLXM0m\n\ti6BG1aPzSpWKPziZx7We0NhepGKSzlrNOslB/6T2kNQRP2bfSdaswTgHW1VRZQc2y+Wi\n\tevztP9J2h7mhoKb7S7Lf0jsNP1TQ0ApfXlWwfVv/YdIr12C3+PuDDmh+nC4uiX+iM44r\n\t7TOwd/HuCcCXdXnxDTqiBG+RdZzh4g5g0GtIMVSRot4fSqdewMnQHkvVWhq0zbOurhVL\n\tmRKA==","X-Gm-Message-State":"AOAM532O4ejMWcK2eVrDdw73k84ce/pt3aF3lV9yySwPzi6F+Ni+FDYy\n\trXmE3yFaURPm/ROUhdrhkjNCuXaxYNNHM1xw","X-Google-Smtp-Source":"ABdhPJz52jQ7h5jxZHy2fWqu1EH2ZSdDzRr49q5b8R14Lqoqcxm7xW9RxI+2P8fXX/Js9SjsNEKJsA==","X-Received":"by 2002:ac2:58d7:: with SMTP id u23mr873351lfo.311.1602076708142;\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:11 +0300","Message-Id":"<20201007131812.2688973-3-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 2/3] ipa: raspberrypi: fix access to\n\tuninitialized variables","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":"Set span_r and span_b to -1 so that when they are passed to Pwl::Eval()\nthey won't cause access to uninitialized memory.\n\nSigned-off-by: Tomi Valkeinen <tomi.valkeinen@iki.fi>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\n---\n src/ipa/raspberrypi/controller/rpi/awb.cpp | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)","diff":"diff --git a/src/ipa/raspberrypi/controller/rpi/awb.cpp b/src/ipa/raspberrypi/controller/rpi/awb.cpp\nindex a5536e4..469d0e5 100644\n--- a/src/ipa/raspberrypi/controller/rpi/awb.cpp\n+++ b/src/ipa/raspberrypi/controller/rpi/awb.cpp\n@@ -430,7 +430,7 @@ double Awb::coarseSearch(Pwl const &prior)\n \n void Awb::fineSearch(double &t, double &r, double &b, Pwl const &prior)\n {\n-\tint span_r, span_b;\n+\tint span_r = -1, span_b = -1;\n \tconfig_.ct_r.Eval(t, &span_r);\n \tconfig_.ct_b.Eval(t, &span_b);\n \tdouble step = t / 10 * config_.coarse_step * 0.1;\n","prefixes":["libcamera-devel","v2","2/3"]}