From patchwork Sat Sep 3 18:10:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 17287 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 711B7C3272 for ; Sat, 3 Sep 2022 18:10:52 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id BD7666203B; Sat, 3 Sep 2022 20:10:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1662228651; bh=eY6aaPLmti0UyBXCKaAeJeRqzUKqF0VFA/mU0p+DHhs=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=aw2FhhuAWx8x/xJILA59SiYqHMe+mvK78CLnKo7FXLbf157N7pj/D02wywm6gX4Oh 9XaZMWYAaa0T5whhBIgSakz9hpWwNP3VSDGkltYW2BI2xIcEOzZBNtfUnSfCmMALI4 ky7pk8s2DKdXmMJgWeWiOXMSdse3xetehJjgq2Kujgr/HaAuXtK/WHm/u8oN9ZLjJY 4yUZAtw8xVcppPWI21/21nvtQqLiwkKGXDizDDuYodv6Qb+v1+zH/co6wQiCFyZ4fJ tFjmoXfCCRjQhRmhmVqP/v8aIkqYlbRWeW/LgRkz8ZZ5dJ05aE8fs061wfPR47QBVc EQ5b8mDju9VMg== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9315B62033 for ; Sat, 3 Sep 2022 20:10:50 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="frAks5kA"; dkim-atps=neutral Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id DF50F4A8; Sat, 3 Sep 2022 20:10:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1662228650; bh=eY6aaPLmti0UyBXCKaAeJeRqzUKqF0VFA/mU0p+DHhs=; h=From:To:Cc:Subject:Date:From; b=frAks5kA5cWkod+snfRh+AeJxZYJEDADJ+Ym5daS+jJYLbmygXZr+0uaJ1dVqBooP vKKitKeC0wCo7Wb3VrWRPE5qF/9GIRI+K24Rqcpix+mSG7hPCoIaRUQJ9TqxkJRfXH QVNu27oS8ByTpRPxOikZ/H/CWSh0Swbz1JwPZvEk= To: libcamera-devel@lists.libcamera.org Date: Sat, 3 Sep 2022 21:10:34 +0300 Message-Id: <20220903181037.1406-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 0/3] libcamera: Fix crash with UVC cameras that expose no supported format 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: Laurent Pinchart via libcamera-devel From: Laurent Pinchart Reply-To: Laurent Pinchart Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Hello, This patch series fixes a crash in the uvcvideo pipeline handler with cameras that exposes only formats that are not supported by libcamera. Patches 1/3 and 2/3 perform small refactoring, to prepare for patch 3/3 that fixes the crash by rejecting those cameras. Laurent Pinchart (3): pipeline: uvcvideo: Move camera ID generation to UVCCameraData class pipeline: uvcvideo: Cache supported formats in UVCCameraData pipeline: uvcvideo: Fail match() if the camera has no supported format src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 200 ++++++++++--------- 1 file changed, 107 insertions(+), 93 deletions(-) base-commit: 251f0534b74bcb46c777aa0df34b1b4142b664f5 Reviewed-by: Umang Jain Tested-by: Christian Rauch