From patchwork Wed Oct 7 11:07:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 10008 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 3C09BBEEE0 for ; Wed, 7 Oct 2020 11:08:08 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id BAF2A605A9; Wed, 7 Oct 2020 13:08:07 +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="Cp9UtNQq"; dkim-atps=neutral Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id BD00860455 for ; Wed, 7 Oct 2020 13:08:06 +0200 (CEST) Received: by mail-lj1-x22e.google.com with SMTP id a5so1522192ljj.11 for ; Wed, 07 Oct 2020 04:08:06 -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=2dKW7thoNLoTpb7x6D3yM/3mYoNj7JwgroKaLWUq1Kc=; b=Cp9UtNQqKwm+bOojsC73cPIyPK9+lTD+qfctP+FYHmdTdWAXshb9JVhAmuHRCa2ssP Qewt0ik7jZq7X3ROYpC6j/ST1RqCaw0ZtkyJsk/+GCCSZjJLJnnIXlV7QgWQnNF+Fy6x usZYLuU/M/L1zYjOlbbIvTuwOQncPtyKorRiQYFOa/C0mZ1IvkCdoVQZpfVWULzyYvpE 4nD2tp/rUvFJbR/SgSs+GwiMKoYLVUeLjpYVDqak9k8ch84mP3b++v7YbLFpb+h8euwP 4qG63D1pf576bXFHXeOxKuPnOJzYpEmrFdNneWoEEEwG8NxjEAEy/qpwe1xHnzr7Vl13 f87w== 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=2dKW7thoNLoTpb7x6D3yM/3mYoNj7JwgroKaLWUq1Kc=; b=qtyyYT9VnYiX+wDYy6k8NW4pjRobvpTsGucwCOjYaDkFeoWXSz615Hjh2J+jUYDRC3 RvOEdRhC6mf3udBbMb63mw2zTcgHh6tVqEQtQdu7N90rFpUEjWhnIVbDvBJTQua29aCd kApyEWToAfg1FkcpcoRaItt3qRU1iwZaQ9KLy4q1w69D6HHfjvpJ65YIgSs1FszI4C93 nhXQiDU10lurg0Cdelw2xzuck5+dfAICPcwown7UxyCk9SqKQKlMmwIUNrB236PPBs1h nFmZc4ut94+ktwE8/OZ6Rwmu206ki/ESQd1rk694blmhgWeIQN/hZ/lo7GOHvOuHUUn3 GaAg== X-Gm-Message-State: AOAM530YFJFOB1+Ma1ob08TihwB1TG+lCwT/fxx6oUQNbiBaaN4od9Ad 8iQe/JfJKcUQLqsocDL4sF6TDog00DQCSQ== X-Google-Smtp-Source: ABdhPJyqwGN9gUXSuAsjuT13XfhukuKqbbjuWzyn5PW1o0z3TzKTb2LWHLOf8rtB0uPetAss3YQSdw== X-Received: by 2002:a2e:b6cf:: with SMTP id m15mr782283ljo.74.1602068886106; Wed, 07 Oct 2020 04:08:06 -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.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Oct 2020 04:08:05 -0700 (PDT) From: Tomi Valkeinen To: libcamera-devel@lists.libcamera.org, Naushir Patuck , David Plowman Date: Wed, 7 Oct 2020 14:07:41 +0300 Message-Id: <20201007110743.55561-3-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 2/4] ipa: raspberrypi: fix missing initialize of status_ 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" Many fields in status_ are not initialized, causing use of uninitialized memory. Drop the code that clears some of the individual fields, and instead just memset the whole thing. Signed-off-by: Tomi Valkeinen Reviewed-by: Kieran Bingham --- src/ipa/raspberrypi/controller/rpi/agc.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/ipa/raspberrypi/controller/rpi/agc.cpp b/src/ipa/raspberrypi/controller/rpi/agc.cpp index df4d364..9e75178 100644 --- a/src/ipa/raspberrypi/controller/rpi/agc.cpp +++ b/src/ipa/raspberrypi/controller/rpi/agc.cpp @@ -148,14 +148,8 @@ Agc::Agc(Controller *controller) exposure_mode_(nullptr), constraint_mode_(nullptr), frame_count_(0), lock_count_(0) { + memset(&status_, 0, sizeof(status_)); ev_ = status_.ev = 1.0; - flicker_period_ = status_.flicker_period = 0.0; - fixed_shutter_ = status_.fixed_shutter = 0; - fixed_analogue_gain_ = status_.fixed_analogue_gain = 0.0; - // set to zero initially, so we can tell it's not been calculated - status_.total_exposure_value = 0.0; - status_.target_exposure_value = 0.0; - status_.locked = false; output_status_ = status_; }