From patchwork Wed Oct 7 11:07:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 10009 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 4B75EBEEE0 for ; Wed, 7 Oct 2020 11:08:10 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1589E60589; Wed, 7 Oct 2020 13:08:10 +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="UkU7GzzR"; dkim-atps=neutral Received: from mail-lf1-x144.google.com (mail-lf1-x144.google.com [IPv6:2a00:1450:4864:20::144]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id AD2BE60589 for ; Wed, 7 Oct 2020 13:08:07 +0200 (CEST) Received: by mail-lf1-x144.google.com with SMTP id l2so1830790lfk.0 for ; Wed, 07 Oct 2020 04:08:07 -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=OySjD9dnYgzNLor4izMnFRzCScZeaXOazSafFJr+/L0=; b=UkU7GzzRwnkDTsbAtI90N/xVtwVY22eEnF2jOvgGgder98edWLcr3GM7Y7uWdut+HM T6Ga93/64v/BqUUimI+t1heDgIW2dMGscwtiovaM5nvCc+WehxjMKs2K5T8WN5X5Xp+F O6mWR1E5QuIBu/d7tIReDivWUtNxFAqPtRJD1eEdrPXKA3JIK7AebFSzvGbx2nJ7OofL MGsSLqnb9SrsFPI/rJV94Qog+T/ZJw3Ad3IOFQCTYFO32r0qbxJ5RgfCgBNuaOM/qCPF 1j5ftD3nePdAWGBtWSuWDU4LFaf4LxY1jvJV9KOaDVxEiCjBAhB1mRg2khKuyR/9gWrU TL3A== 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=OySjD9dnYgzNLor4izMnFRzCScZeaXOazSafFJr+/L0=; b=mVeECvlffp7wZG+QlUY27twkrursVdzNKN75UlQyWgMqRD1K66hCppIRbb3CBy26EQ 1U4hkdfX5LRmypBfloroKBnaqXP+1G29roQIOUwhPre+mGQOuvwjyml5LuJiCBtbpN5r BH1EeII5ZX2zZmI4mhQ0SHaPzzk6kd1qv9/vhHW41ORw5tQhk8lxGZCVko6wUPuT+0cm Al6JjUF1GAPQ0LpXbaAhtHWbVsMw8VHEAyllJ/9tPEw+LpdANwrqSYQnRIiFaGhnFMPP ATGj1aBEaP1VCm5v2bQJ/x4LQX7gcfXDESFRVdCwYn6YAaz1pi4uzr2GjQRoyq4bgeP/ 840A== X-Gm-Message-State: AOAM532xwQQq37jw2t+KI+t3L4XqN3ieBUPQQqNwmD7so6LBjrdYzSbu ie6PaQMKcROa5WSKLN/qyQAVfNnLJzx9lA== X-Google-Smtp-Source: ABdhPJxUcsU4PKZ2QaCgvxm4cHEFIvdtQhne9ZBFhcr5fdf/VxvLkWL1A01bs6gSgK/4ihNHfSNmMw== X-Received: by 2002:a19:8286:: with SMTP id e128mr729245lfd.307.1602068887019; Wed, 07 Oct 2020 04:08:07 -0700 (PDT) Received: from deskari.lan (91-152-83-50.elisa-laajakaista.fi. [91.152.83.50]) by smtp.gmail.com with ESMTPSA id x14sm287445lfc.93.2020.10.07.04.08.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Oct 2020 04:08:06 -0700 (PDT) From: Tomi Valkeinen To: libcamera-devel@lists.libcamera.org, Naushir Patuck , David Plowman Date: Wed, 7 Oct 2020 14:07:42 +0300 Message-Id: <20201007110743.55561-4-tomi.valkeinen@iki.fi> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201007110743.55561-1-tomi.valkeinen@iki.fi> References: <20201007110743.55561-1-tomi.valkeinen@iki.fi> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 3/4] 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;