From patchwork Thu Feb 23 20:47:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suhrid Subramaniam X-Patchwork-Id: 18305 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 5BA48BE080 for ; Thu, 23 Feb 2023 21:04:05 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A9F7B6265D; Thu, 23 Feb 2023 22:04:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1677186244; bh=OvFOgdhytnUxq9sLHEK9OxfYsVRB2KT92yJ8nZXUIQo=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=QKQyH+ERGfGy9DNutlQ2rIzFVqaqhblh20SHbRmubTJsU6eGAW/BEcw4zt39W5z6K DxSZx+Qrk6+XdI8n7wN7MRDwGGHwoa6pz+Nj8HapQ8K2KfsZcndmzoU0JQEW+LDqUG VN64rbdJEoB+9Jos02M2Gc8+5D/M+5QTtujHQvo0OMMoWFjlu+ughSoNLVNnFgO7at S1KTKSSDQw/d2hv5VPBxWm/VmRz9j4XktzUbSTizxDC2BRd7K9uz/wemA/bL642A/O HXRe2zd8mP0HRZFUHi3dE0W9L8igO/0G/RuGTbZTKcI2Qh2nn1BpRSDEn64eJqAtIY Drqgw5m3+kZGA== Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 06438603B4 for ; Thu, 23 Feb 2023 21:50:18 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Nb5+on21"; dkim-atps=neutral Received: by mail-pl1-x631.google.com with SMTP id i10so5614871plr.9 for ; Thu, 23 Feb 2023 12:50:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1677185416; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=55bXgzJ7lgqJoz6t2+4fIitcYoL4Exh0HE4g/IB3upo=; b=Nb5+on21WnDoBZnczA9srtCm5WdfUGcvT1PfwUnOnKeXR3wDvV/Tvi7o414uKhtXDc WgKI5/YG9icTNp5K/tqf241LdJPNM+4h79YHPmKgU7SIJUsrULW+Y5KTvvtS3q5NhRIE 01/jo2uuQq33SdaofdWWhzuzxH5lIqXFunq9qbGqa6wV/2wuu2pkrfcvDp9gE9+2SScr NQ7T9qrNd91SzHJJ5PQHrKLLguM4g+zGK5d9yxg848ttzbUmx5wbJgU424eyC7gIKPxe +DBTnFKV5daAgTtvBlERZgCBeyGnIs5zisH+1IvGPG6F4K/86lFIIBziyi+q6IZ+x/Ov qiaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677185416; h=content-transfer-encoding:mime-version: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=JDGwBFFo+PdFUe+t5NpxyFrOytixLCFCwmPOmRX9ltubbVKtNV0wbpFGprSzfiGDj9 tbiceNPvo6O0amC8/AK9FdIhgyXaK2f/1R/Dmdhn+Ux1QHsmcjuoY4hpHCh5GrFRTnyu MPKVQRYZTjbgLIXDu11+yMT0BsmWYSLbc4GCkJc4EAxRZdvJfojwf7X364L7mTJemQ8+ 30/EfJKL+FSf8drfakuWh78v4ChkCTM6azDzEIH30uoYbv5U2G30P+7ZvE0+qZCQ9wX0 5Ueqh+gWfst7duz18wBtjNX7UzHpmyptf0+v0l2aCwRfjOYxfQKeFhcjmvnqbCNqLtZd KJJg== X-Gm-Message-State: AO0yUKWVYz+oiyA+YksdTPIb8tPg5NkwH50/60BHUk2oHd353+dgx6eV 2r2gQMByNp+EWuPSBE52RHv/KHOdm/M6dLhKfY8= X-Google-Smtp-Source: AK7set/WUHV3bx9GTmF8dqEDRstH5sWWT2CCJN2nvKoZTWa1ZX91sk5NUwbVB8b3L/Di6VFRx887Tw== X-Received: by 2002:a17:902:ea03:b0:196:56c8:cfab with SMTP id s3-20020a170902ea0300b0019656c8cfabmr13913833plg.1.1677185415901; Thu, 23 Feb 2023 12:50:15 -0800 (PST) Received: from localhost.localdomain (sfosm0151r356001-v22.wiline.com. [67.207.106.98]) by smtp.gmail.com with ESMTPSA id k17-20020a170902761100b0019a8468cbedsm4217942pll.226.2023.02.23.12.50.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Feb 2023 12:50:15 -0800 (PST) X-Google-Original-From: Suhrid Subramaniam To: libcamera-devel@lists.libcamera.org Date: Thu, 23 Feb 2023 12:47:57 -0800 Message-Id: <20230223204755.46740-1-suhrid.subramaniam@mediatek.com> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 23 Feb 2023 22:04:03 +0100 Subject: [libcamera-devel] libcamera: pipeline: simple: Check if converter_ is a nullptr 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();