From patchwork Mon Feb 27 22:49:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suhrid Subramaniam X-Patchwork-Id: 18317 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 D1C29BE08A for ; Mon, 27 Feb 2023 22:50:44 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 97BFD6267E; Mon, 27 Feb 2023 23:50:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1677538244; bh=OvFOgdhytnUxq9sLHEK9OxfYsVRB2KT92yJ8nZXUIQo=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=CXhxcOfn6Y/BQI9flxxyU8sMYsPLDcqhguAqZ0TaSS/pLV7bm5AtgYJj6Qb/k5hay DDAfT9zj+ISnBZEs/Aqegxf7C9BJCz0NvOPf/O8s+IczzS6mirF4X0lHR9qY3LrcC+ ttejm4F2Au7dFv7c+pu5uhtMkseRyPudqlvtSNJ+rZvoUJCU4IwADnOObcIxpH0IZQ Qw4O8O7TwiVur5BOaJ1UJ6cdTGF6BhwgbwAu2j9ab0NXM+t4Jaagu0DGvxdR0trHgz OK2E9xbRAi5yLjKIAcN5Fx3jlH7s9bzhYpigqBd0c4H4bFFWYl6HFf8Pr0WBTEXMYj 4M7gr2yr55AmA== Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com [IPv6:2607:f8b0:4864:20::52d]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 79A7662676 for ; Mon, 27 Feb 2023 23:50:42 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="QnO/00Z1"; dkim-atps=neutral Received: by mail-pg1-x52d.google.com with SMTP id s17so4560246pgv.4 for ; Mon, 27 Feb 2023 14:50:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1677538241; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=55bXgzJ7lgqJoz6t2+4fIitcYoL4Exh0HE4g/IB3upo=; b=QnO/00Z1ePSztY6hLd8iGMp7Rcxeib5VN0p8rwsJqDVSx/xXcY06+hQ4sIjCOV3tU5 uaPtCnJwvWk3jg36mSCJfzwH7OO7cPfu5qTLJ3EsFsJBmInqqwT3gvXMLmW4rTqSbgq/ 3tyZXgx5s76twCc6RXGXkVj0naqEisfsoM6EwdCTT051hEGotwdSaSLbImwivBapraLy xv+FvV2pfyiU0GqAOwzSLcmMFuf4RRfLYjXZrt++CPLRYNKlJXg1odpMhGShyuAaY3HR /h0KxLphqgiVkUaJ1ZMP9OlHbqC906EOurgnyU9abkfq4iTCe/XD2+i9yFINQwfUmPQp mXaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677538241; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=55bXgzJ7lgqJoz6t2+4fIitcYoL4Exh0HE4g/IB3upo=; b=olq06BMy2TjJT2Ecwpd9IPlqvfJVpc+Bm7Bbgn09Fw57bpGCOMwZGjb3xE/WKhNQQW J0Wg0lsZlAAKD9qEclWg0ACf6AczFp8E9zZEf3DnQxp7CIzcSFe6jMIeir/kFoAkQTLX 0lqjQCnUCmhcsUACzCkovyq0nVbY6rbQdyHooZyxt2uZcyqYCfyuPn+f+Yh7aIFZ8ger 7Q36pjDCjd0iXzTYJ8cgInaGjbHqCXbzIIyzNvdWvUVibb0udMpKhD87BZbqbmALdb6M J+ZyvOmzHygnNsjK9g8Mh7Y86OnokkMLR9pSviTDE3pz+UxnUlh0++tB+dMIN2zo7+iP ubWw== X-Gm-Message-State: AO0yUKXGztkk9bOScp8GOFKzStSJmPQFmZe7oA/r40t1oh7NEUKS5syS 1LABaBO7dmDpQ+btSRmGvmYz8ddKuXsv4Q== X-Google-Smtp-Source: AK7set+SnyStz1lifNiTX2+mWzfIl/4PTC/trGhkUBiAcMC9UNlLvWGRX1ipzUsF2YwMGSQxqGPB7g== X-Received: by 2002:aa7:85d7:0:b0:5f5:313e:49dd with SMTP id z23-20020aa785d7000000b005f5313e49ddmr670766pfn.1.1677538240700; Mon, 27 Feb 2023 14:50:40 -0800 (PST) Received: from localhost.localdomain (sfosm0151r356001-v22.wiline.com. [67.207.106.98]) by smtp.gmail.com with ESMTPSA id 17-20020aa79111000000b005e00086250asm4663117pfh.125.2023.02.27.14.50.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Feb 2023 14:50:40 -0800 (PST) X-Google-Original-From: Suhrid Subramaniam To: libcamera-devel@lists.libcamera.org Date: Mon, 27 Feb 2023 14:49:09 -0800 Message-Id: <20230227224910.151337-2-suhrid.subramaniam@mediatek.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230227224910.151337-1-suhrid.subramaniam@mediatek.com> References: <20230227224910.151337-1-suhrid.subramaniam@mediatek.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 1/2] libcamera: pipeline: simple: Check converter_ 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: Suhrid Subramaniam via libcamera-devel From: Suhrid Subramaniam Reply-To: Suhrid Subramaniam Cc: Suhrid Subramaniam Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" - If no converter is found, converter_ becomes a nullptr and !converter_->isValid() causes a segmentation fault. - Avoid this by checking if converter_ is a nullptr. Signed-off-by: Suhrid Subramaniam --- src/libcamera/pipeline/simple/simple.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp index 24ded4db..2423ec10 100644 --- a/src/libcamera/pipeline/simple/simple.cpp +++ b/src/libcamera/pipeline/simple/simple.cpp @@ -493,7 +493,7 @@ int SimpleCameraData::init() MediaDevice *converter = pipe->converter(); if (converter) { converter_ = ConverterFactoryBase::create(converter); - if (!converter_->isValid()) { + if (!converter_) { LOG(SimplePipeline, Warning) << "Failed to create converter, disabling format conversion"; converter_.reset();