From patchwork Fri Mar 31 15:09:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mattijs Korpershoek X-Patchwork-Id: 18521 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 36C4EC0F2A for ; Fri, 31 Mar 2023 15:10:05 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 984CF62742; Fri, 31 Mar 2023 17:10:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1680275404; bh=o9NzB71oYIvyHtcUaflo5QXmDPQ9pRfmc3TGniS9Uss=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=XYxe1Y2rrKuq8Ubwkg0oJdWWbFYOarI8s+fwUgVgoYMsoE/MzWA7st2mUqT4XWuP6 71si4bQVD+MJrwhAAcKuTFUo8R7IDgAXk1CurIkzLJqyOeV4hlGCSpB78zASitGInL 7qkciQ+GbwR+rIHVSPCePLLz/9A0SZkyd5e/5raw1JApcvz1Fpen7DshAHFd23HYmj 1d5ynz40ZtY+jV0YeXTkRv7qHcHuOt+F8Ue6aVSOP6cVtA6WCRbM9nRmg4JeVUawmf 4mCjH9I98lhl20Y7STFUfXbmplLeFjG4RB9oYEulO6DuF7DFHGCPSaVftwLmaGvCQi OEQkDb6wYuU2w== Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id AE57A603A7 for ; Fri, 31 Mar 2023 17:10:03 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=baylibre-com.20210112.gappssmtp.com header.i=@baylibre-com.20210112.gappssmtp.com header.b="CJjwXEja"; dkim-atps=neutral Received: by mail-wr1-x436.google.com with SMTP id d17so22752548wrb.11 for ; Fri, 31 Mar 2023 08:10:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; t=1680275403; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:from:to:cc:subject:date:message-id:reply-to; bh=ni2fl0SP/ePS87kog1uCKOA/ZfB68OaNYxfKhDfprAA=; b=CJjwXEja+DUI+I/ijj1OIrclhvlsSIcfxYK4HppJpCNJsFoexGnztrchROIXCgNMmM ULuTVjE1E/8kk1V1XFOQ7qyqdVEVSnJ1H+vcElSXz492pSK1b6uLn7hyeTGHGZrrNnDe 0MDu3z1ymToqX0WY6sGxQ2n54mn1+Ot8oXPKUWQqymB8cQiNtioMcmpxRdKY0z6NeuAJ EEBNscMzomZOy9LG74CEudwnQFl0jXh4NFpoH0meuUhOawGMqKdUmn/yTAoqBgpBY/Ct Luu5o+Xb/AzCUpflNJ/EQ/lPNRjMYjjl7lVI9C+yUlo8Ha9HfAAKTKSg+KOhXsoIZO/0 ZnUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680275403; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ni2fl0SP/ePS87kog1uCKOA/ZfB68OaNYxfKhDfprAA=; b=0a/yFoqZgtdOk686Wodasm2GY7nouOS0VXn8Tlrm4jV+5G76rszXo5LzBNiNIyY5zt V/U7Bkad8DnI4+1R+9R3M9wWei5JV0eSfGQdztkcW37T2/vSGT+oAzSMw36ANrjdzilC CPrXUugNPMzrKUnrNmpjWl86Vkf3a8Zpb10SIwgqZCLaGrSsigaRK4WrtJG95dfKi6sO cy1MOEhGZ6x2RJdrJEhhs046RiwgxGr8zjd4/Abe+cLv98qd0oOGhprOMKdChg7I55x8 xaEbUHXMTSW2vNppEbW6N7Gg593ffE/51WTcXnCrkKsBwXFDZDQXw08oavYyGlSqMPwn dtSQ== X-Gm-Message-State: AAQBX9cHkMyKGt0ExIoCQ1795+QGR29E12bjDO/elpisuw3PB1jpqVj8 6v2pxorENvGX7puYWEKjhJCj+g== X-Google-Smtp-Source: AKy350ZAUchoTXBD1d3FTQ65Pp+vpZRS71b1hAKlOLAtiRiNbusbsHXpcG8D4Hn0F7dJmvAjZiyDbQ== X-Received: by 2002:a05:6000:1009:b0:2cf:f01f:ed89 with SMTP id a9-20020a056000100900b002cff01fed89mr20286188wrx.24.1680275403153; Fri, 31 Mar 2023 08:10:03 -0700 (PDT) Received: from [192.168.1.20] ([2a01:cb19:85e6:1900:2bf7:7388:731d:c4e1]) by smtp.gmail.com with ESMTPSA id n11-20020a5d660b000000b002c54c9bd71fsm2392532wru.93.2023.03.31.08.10.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Mar 2023 08:10:02 -0700 (PDT) Date: Fri, 31 Mar 2023 17:09:58 +0200 MIME-Version: 1.0 Message-Id: <20230331-simple-controls-v1-1-f7b8327d2c26@baylibre.com> X-B4-Tracking: v=1; b=H4sIAMX3JmQC/x2NywqDMBAAf0X23FBNkD5+pXiI66ZZ1CTsllIQ/ 73R48AMs4GSMCk8mw2EvqycU4Xu0gBGn95keKoMtrWuda4zymtZyGBOH8mLmjA97L13eMMQoFa jVzKj+ITx6NY5SyHRmGm+ovKhFKHAv3P6Gvb9DwYmS0aEAAAA To: libcamera-devel@lists.libcamera.org X-Mailer: b4 0.13-dev-00303 Subject: [libcamera-devel] [PATCH] pipeline: simple: set controlInfo_ to sensor_->controls() 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: , X-Patchwork-Original-From: Mattijs Korpershoek via libcamera-devel From: Mattijs Korpershoek Reply-To: Mattijs Korpershoek Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Each pipeline has a ControlInfoMap to list the set of controls supported by the camera. ControlInfoMap() default constructor -used by simple pipeline-, initializes its idmap_ member to nullptr. Other methods such as ControlInfoMap::find() don't check for idmap_'s validity so the following code (from find()) crashes: auto iter = idmap_->find(id); auto iter = nullptr->find(id); Fix this by assigning the sensor's control info map. Signed-off-by: Mattijs Korpershoek --- Alternatively, we could null check everywhere in controls.cpp or get rid of the default constructor for ControlInfoMap. --- src/libcamera/pipeline/simple/simple.cpp | 1 + 1 file changed, 1 insertion(+) --- base-commit: ac7511dc4c594f567ddff27ccc02c30bf6c00bfd change-id: 20230331-simple-controls-fd92853c7cff Best regards, diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp index 2423ec10c878..4db3dc2812b0 100644 --- a/src/libcamera/pipeline/simple/simple.cpp +++ b/src/libcamera/pipeline/simple/simple.cpp @@ -537,6 +537,7 @@ int SimpleCameraData::init() } properties_ = sensor_->properties(); + controlInfo_ = sensor_->controls(); return 0; }