[{"id":26489,"web_url":"https://patchwork.libcamera.org/comment/26489/","msgid":"<Y/2kHu9wgVZ7o+MB@pyrite.rasen.tech>","date":"2023-02-28T06:50:06","subject":"Re: [libcamera-devel] [PATCH v2 1/2] libcamera: pipeline: simple:\n\tCheck converter_","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"On Mon, Feb 27, 2023 at 02:49:09PM -0800, Suhrid Subramaniam via libcamera-devel wrote:\n> - If no converter is found, converter_ becomes a nullptr and\n> !converter_->isValid() causes a segmentation fault.\n> - Avoid this by checking if converter_ is a nullptr.\n> \n> Signed-off-by: Suhrid Subramaniam <suhrid.subramaniam@mediatek.com>\n> ---\n>  src/libcamera/pipeline/simple/simple.cpp | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\n> index 24ded4db..2423ec10 100644\n> --- a/src/libcamera/pipeline/simple/simple.cpp\n> +++ b/src/libcamera/pipeline/simple/simple.cpp\n> @@ -493,7 +493,7 @@ int SimpleCameraData::init()\n>  \tMediaDevice *converter = pipe->converter();\n>  \tif (converter) {\n>  \t\tconverter_ = ConverterFactoryBase::create(converter);\n> -\t\tif (!converter_->isValid()) {\n> +\t\tif (!converter_) {\n\nWe still need to check that the converter is valid if it exists.\n\n\nPaul\n\n>  \t\t\tLOG(SimplePipeline, Warning)\n>  \t\t\t\t<< \"Failed to create converter, disabling format conversion\";\n>  \t\t\tconverter_.reset();\n> -- \n> 2.39.0\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 408B6BE08A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 28 Feb 2023 06:50:17 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 93C9162696;\n\tTue, 28 Feb 2023 07:50:16 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B515562676\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 28 Feb 2023 07:50:15 +0100 (CET)","from pyrite.rasen.tech (h175-177-042-159.catv02.itscom.jp\n\t[175.177.42.159])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id D109356A;\n\tTue, 28 Feb 2023 07:50:13 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1677567016;\n\tbh=LSz3QZJ55lxQPoSDfBStghqsSMh51Z7HyUftbeM7M2o=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=ELe9r0CicvIgLB5KkSgDDp5dC1MryQqdkFa+Lt3p5a4eWc8Nghf/Busl8OhViVPFp\n\tGSfWpZq2y4kztmeUPtjX/7gnNffw9fzyTdLXiQh2isUbH27WLDUpE6QphB6CG6+oE/\n\tTvIY2+Ztq6/st8CnVkAVCQxIzVRJUO49158And1vMvmU/fQJcA+S3aS8FDeSkwhg25\n\tgAbM4YEBscz7qeSvbdlVET+3MI9xd43x5iiWk08D2/DUbu0qprWEWx9vzWt7U/PjHb\n\tsaga5+TBUTk+MM9sF1yaoPDX1Y5B3lKOvHC/ofJcUpoHzzDyg8Jmp6IvxcogIqQqSe\n\ts402civwbborg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1677567015;\n\tbh=LSz3QZJ55lxQPoSDfBStghqsSMh51Z7HyUftbeM7M2o=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=rb8Z1c9BJMu3DQOmNrgoLdXP9E1b0LkjAt4wtQGp4WY9pOUgQ+i46YvmtVe9tJaNI\n\t19w9TECwj7JLKLFwIekWEbhDt7fOjtmxlQH7JGaCPjcWYRG8c0Q8+AljzL3OR4Kz1L\n\tzNAsj9X0RPZ0YgDb6QPPtaqM+pSQ7+5XMsAj/O4s="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"rb8Z1c9B\"; dkim-atps=neutral","Date":"Tue, 28 Feb 2023 15:50:06 +0900","To":"Suhrid Subramaniam <suhridsubramaniam@gmail.com>","Message-ID":"<Y/2kHu9wgVZ7o+MB@pyrite.rasen.tech>","References":"<20230227224910.151337-1-suhrid.subramaniam@mediatek.com>\n\t<20230227224910.151337-2-suhrid.subramaniam@mediatek.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20230227224910.151337-2-suhrid.subramaniam@mediatek.com>","Subject":"Re: [libcamera-devel] [PATCH v2 1/2] libcamera: pipeline: simple:\n\tCheck converter_","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Paul Elder via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Paul Elder <paul.elder@ideasonboard.com>","Cc":"Suhrid Subramaniam <suhrid.subramaniam@mediatek.com>,\n\tlibcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]