From patchwork Fri Feb 1 15:42:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 477 Return-Path: Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8EB0D60DB5 for ; Fri, 1 Feb 2019 16:42:41 +0100 (CET) X-Originating-IP: 91.183.179.147 Received: from uno.localdomain (unknown [91.183.179.147]) (Authenticated sender: jacopo@jmondi.org) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 3DDA81BF205; Fri, 1 Feb 2019 15:42:41 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Fri, 1 Feb 2019 16:42:46 +0100 Message-Id: <20190201154248.15006-6-jacopo@jmondi.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190201154248.15006-1-jacopo@jmondi.org> References: <20190201154248.15006-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 5/7] libcamera: v4l2_device: Zero-initialize V4L2 format X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2019 15:42:41 -0000 Zero initialize v4l2_format structures used to set and get format on the V4L2 device. Signed-off-by: Jacopo Mondi Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- src/libcamera/v4l2_device.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp index 0d4d60f..b86a629 100644 --- a/src/libcamera/v4l2_device.cpp +++ b/src/libcamera/v4l2_device.cpp @@ -299,7 +299,7 @@ int V4L2Device::setFormat(V4L2DeviceFormat *format) int V4L2Device::getFormatSingleplane(V4L2DeviceFormat *format) { - struct v4l2_format v4l2Format; + struct v4l2_format v4l2Format = {}; struct v4l2_pix_format *pix = &v4l2Format.fmt.pix; int ret; @@ -323,7 +323,7 @@ int V4L2Device::getFormatSingleplane(V4L2DeviceFormat *format) int V4L2Device::setFormatSingleplane(V4L2DeviceFormat *format) { - struct v4l2_format v4l2Format; + struct v4l2_format v4l2Format = {}; struct v4l2_pix_format *pix = &v4l2Format.fmt.pix; int ret; @@ -344,7 +344,7 @@ int V4L2Device::setFormatSingleplane(V4L2DeviceFormat *format) int V4L2Device::getFormatMultiplane(V4L2DeviceFormat *format) { - struct v4l2_format v4l2Format; + struct v4l2_format v4l2Format = {}; struct v4l2_pix_format_mplane *pix = &v4l2Format.fmt.pix_mp; int ret; @@ -371,7 +371,7 @@ int V4L2Device::getFormatMultiplane(V4L2DeviceFormat *format) int V4L2Device::setFormatMultiplane(V4L2DeviceFormat *format) { - struct v4l2_format v4l2Format; + struct v4l2_format v4l2Format = {}; struct v4l2_pix_format_mplane *pix = &v4l2Format.fmt.pix_mp; int ret;