From patchwork Wed Nov 4 07:48:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 10330 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 4641CBE080 for ; Wed, 4 Nov 2020 07:49:35 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C190462BC9; Wed, 4 Nov 2020 08:49:34 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="OcXU3qxK"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6B9F260344 for ; Wed, 4 Nov 2020 08:49:33 +0100 (CET) Received: from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id EC353563 for ; Wed, 4 Nov 2020 08:49:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1604476173; bh=Xlb6pjUgn/lhuJdTdvYD7VNhw0Bes1mCHzgS11w/FCk=; h=From:To:Subject:Date:From; b=OcXU3qxKNfSw3fANjDi23xnY5BNL7Gfye4vCFgBOTyRCgPT7GxhZD5lim7qSCWkze 5Ng7KQT9auoYDlklMps0Vg+/YqcP9z7k5T6F0Sv0snxDrHpTmKjtNYz3lkPdH6Cm1/ O++WfbdcNetRQfc9yV25pojH9KvKcUZXYuI+etzY= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Wed, 4 Nov 2020 09:48:38 +0200 Message-Id: <20201104074841.21676-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 0/3] libcamera: Fix uninitialized use of V4L2DeviceFormat members 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Hello, This small series fixes uninitialized uses of planes and planesCount members of the V4L2DeviceFormat class. It supersedes the following two patches (hence the v2): [PATCH 1/2] libcamera: v4l2_videodevice: Check plane count when setting format [PATCH 2/2] libcamera: pipeline: simple: Initialize V4L2DeviceFormat before use The approach taken here is different, instead of adding missing initialization in the users of the class, and starting a game of whack-a-mole, patch 1/3 adds initializers in the class itself. Patch 2/3 hasn't changed compared to 1/2 of v1, and patch 3/3 drops now unneeded explicit initialization. The series has been tested by removing patch 1/3, noticing assertion failures in unit tests, and verifying that patch 1/3 fixes the issue. Laurent Pinchart (3): libcamera: v4l2_videodevice: Zero-initialize planes in V4L2DeviceFormat libcamera: v4l2_videodevice: Check plane count when setting format libcamera: Drop unnecessary explicit initialization of V4L2DeviceFormat include/libcamera/internal/v4l2_videodevice.h | 13 ++++++++----- src/libcamera/pipeline/ipu3/ipu3.cpp | 2 +- src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 6 +++--- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 4 ++-- src/libcamera/pipeline/rkisp1/rkisp1_path.cpp | 4 ++-- src/libcamera/pipeline/simple/converter.cpp | 2 +- src/libcamera/pipeline/simple/simple.cpp | 4 ++-- src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 4 ++-- src/libcamera/pipeline/vimc/vimc.cpp | 4 ++-- src/libcamera/v4l2_videodevice.cpp | 11 +++++++++++ 10 files changed, 34 insertions(+), 20 deletions(-)