From patchwork Wed Oct 7 13:18:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 10016 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 4F39EBEEE0 for ; Wed, 7 Oct 2020 13:18:32 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 03BF6605C7; Wed, 7 Oct 2020 15:18:32 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="N/lcLhPC"; dkim-atps=neutral Received: from mail-lf1-x142.google.com (mail-lf1-x142.google.com [IPv6:2a00:1450:4864:20::142]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5ECEC605C1 for ; Wed, 7 Oct 2020 15:18:30 +0200 (CEST) Received: by mail-lf1-x142.google.com with SMTP id a9so2240054lfc.7 for ; Wed, 07 Oct 2020 06:18:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DV8vcqf/qgNOAuvGzM1EorYjKQ/K1c2uv/hvw8RyPIc=; b=N/lcLhPCL8gphSIoGKCI9WHk/dodyklktKCZP3J8wCPsiYJIhbrB0JHQG6QX1AJB2Y 5Rzk01Hie930ImTXi5vA504Adp1lNMUYltsIpgNdD9Ib59YEGATq34maONGGzt9U46yD 7secXuilzS5B1kSifTr+3/+YSkhndIu+WBSITyf25Ln82/gSbYbMIU99rsJn8BnsSr+n RGdLa2YNuAm+87si2ax95OdD6WlmLOcZ3ibubGLwoH5Op2PwtMfulOmOPtvYjzJacJD1 FEvidgw1Adfc5Xgd4XWgH5JpSkDeZZtREM5XfLQWndvZmslXx42QSS83tpbWw4f08vhk s4KQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=DV8vcqf/qgNOAuvGzM1EorYjKQ/K1c2uv/hvw8RyPIc=; b=Mi+IawAGuu+DdAkkl/udARBJ+6qGFP8hkaKgSwXLOuBvtcj/eU+zE4HRb8JMBGj3j2 MG+ze452UeJzr7DmI2ynYYQqGDRpVh9mXAuBDPkFE7rHyLLY7Pfz7iSOLufCNRuLXM0m i6BG1aPzSpWKPziZx7We0NhepGKSzlrNOslB/6T2kNQRP2bfSdaswTgHW1VRZQc2y+Wi evztP9J2h7mhoKb7S7Lf0jsNP1TQ0ApfXlWwfVv/YdIr12C3+PuDDmh+nC4uiX+iM44r 7TOwd/HuCcCXdXnxDTqiBG+RdZzh4g5g0GtIMVSRot4fSqdewMnQHkvVWhq0zbOurhVL mRKA== X-Gm-Message-State: AOAM532O4ejMWcK2eVrDdw73k84ce/pt3aF3lV9yySwPzi6F+Ni+FDYy rXmE3yFaURPm/ROUhdrhkjNCuXaxYNNHM1xw X-Google-Smtp-Source: ABdhPJz52jQ7h5jxZHy2fWqu1EH2ZSdDzRr49q5b8R14Lqoqcxm7xW9RxI+2P8fXX/Js9SjsNEKJsA== X-Received: by 2002:ac2:58d7:: with SMTP id u23mr873351lfo.311.1602076708142; Wed, 07 Oct 2020 06:18:28 -0700 (PDT) Received: from deskari.lan (91-152-83-50.elisa-laajakaista.fi. [91.152.83.50]) by smtp.gmail.com with ESMTPSA id i139sm329539lfi.276.2020.10.07.06.18.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Oct 2020 06:18:27 -0700 (PDT) From: Tomi Valkeinen To: libcamera-devel@lists.libcamera.org, Naushir Patuck , David Plowman 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 uninitialized variables X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tomi Valkeinen Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Set span_r and span_b to -1 so that when they are passed to Pwl::Eval() they won't cause access to uninitialized memory. Signed-off-by: Tomi Valkeinen Reviewed-by: Kieran Bingham Reviewed-by: David Plowman --- src/ipa/raspberrypi/controller/rpi/awb.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ipa/raspberrypi/controller/rpi/awb.cpp b/src/ipa/raspberrypi/controller/rpi/awb.cpp index a5536e4..469d0e5 100644 --- a/src/ipa/raspberrypi/controller/rpi/awb.cpp +++ b/src/ipa/raspberrypi/controller/rpi/awb.cpp @@ -430,7 +430,7 @@ double Awb::coarseSearch(Pwl const &prior) void Awb::fineSearch(double &t, double &r, double &b, Pwl const &prior) { - int span_r, span_b; + int span_r = -1, span_b = -1; config_.ct_r.Eval(t, &span_r); config_.ct_b.Eval(t, &span_b); double step = t / 10 * config_.coarse_step * 0.1;