From patchwork Thu Dec 14 21:34:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Machek X-Patchwork-Id: 19327 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 D94ADBD87C for ; Thu, 14 Dec 2023 21:34:03 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2878F62B32; Thu, 14 Dec 2023 22:34:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1702589643; bh=OjKqM7d+w8BUlKiqUae1KcSRjAKjT/heD7L8ljW5qp8=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=CArs7vTuU7Ude2SHIvidfIUDq5thyajm61nABGVRCa5IPDjjEnhegrVMo5J9OJq4O t9uSsX35IhB/qR56BNlZ1ZtySqdnTAMurfc6ij4FmZKO9SpShaIZSe8XEgHlHMaXr4 QKJ/7gbU/PV8z71fK8n4bxtqbsZt1V6v8+ceN92AUzd8IyJTuwbFNu/jxOP/V1OTQs YcwcL6EqW4zZc1dqWcFWYz2bxmMpDry9c8BhiDF4elh00C7/Xfk54ffBK2k1sjvvD3 RvlYECGleD9e9en+pPXqqB3OHlAp4c819OahMP2JMlJ4nFPBD9qZkq46+Zpw3sTRDU kObpRvaa1zsJw== Received: from jabberwock.ucw.cz (jabberwock.ucw.cz [46.255.230.98]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7C55461D97 for ; Thu, 14 Dec 2023 22:34:01 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ucw.cz header.i=@ucw.cz header.b="Ea9Kw7U6"; dkim-atps=neutral Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id E91821C006F; Thu, 14 Dec 2023 22:34:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ucw.cz; s=gen1; t=1702589640; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=zkTCoVpie48sjXcrbhUD3V/orSYISXxGQXjhiQNciBs=; b=Ea9Kw7U6owQC9KSqHXWRuHW5FkSN+wqoWkJbPoSUOMp4W82q1UN2bZS8K7tbceReUPlx5u w8U9hKXQK/hYWLnSDOpiWohGveW8O7fNvpWf0IB5/jviJEFrlWM5M6YHxeSCZ6LD7lOoym 7iUUAxvj43IfLMkN8qhf6dFS1b1N+AE= Date: Thu, 14 Dec 2023 22:34:00 +0100 To: libcamera-devel@lists.libcamera.org Message-ID: MIME-Version: 1.0 Content-Disposition: inline Subject: [libcamera-devel] [PATCH] Avoid segfault with bad configuration 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: Pavel Machek via libcamera-devel From: Pavel Machek Reply-To: Pavel Machek Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Without this patch, I get segfault instead of "Failed to get default stream configuration" message. Signed-off-by: Pavel Machek diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp index bdc7bfe5..8a315bfd 100644 --- a/src/libcamera/pipeline/simple/simple.cpp +++ b/src/libcamera/pipeline/simple/simple.cpp @@ -1138,6 +1138,8 @@ SimplePipelineHandler::generateConfiguration(Camera *camera, Spanfirst) + continue; cfg.pixelFormat = formats.begin()->first; cfg.size = formats.begin()->second[0].max;