From patchwork Tue Jul 16 06:00:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 1706 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8D1A1618D3 for ; Tue, 16 Jul 2019 08:01:15 +0200 (CEST) Received: from pendragon.ideasonboard.com (unknown [IPv6:2a00:79e1:abc:3602:59ec:6c:1869:337]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 42D12564 for ; Tue, 16 Jul 2019 08:01:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1563256875; bh=fX/xYLk4WVordVhYdt2eP+uE0yE9XH8fVSTkceWlasU=; h=From:To:Subject:Date:From; b=ernsie2eoD3i2fYRbJmypAqwMXh/qLPqiiQONbUw2YJpnNjkDcEYR2uxKqJdsdeiz lGi8lXDZ5PANplkTgjepGGqnQH+r11eu6A37TQbRqEx7auolg30qanTkditmu3JXzt WP6Y5X9XlWOLmvWKphuJHP7ofvX8L9b3rqfCu18k= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Tue, 16 Jul 2019 09:00:42 +0300 Message-Id: <20190716060042.23035-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] libcamera: stream: Initialise pixelFormat in StreamConfiguration() 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: Tue, 16 Jul 2019 06:01:15 -0000 To avoid depending on unitialised values, set the pixelFormat field of the StreamConfiguration class to 0 in the constructor. Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund Reviewed-by: Paul Elder --- src/libcamera/stream.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp index de505d12c07a..c28b4cd669b2 100644 --- a/src/libcamera/stream.cpp +++ b/src/libcamera/stream.cpp @@ -289,7 +289,7 @@ SizeRange StreamFormats::range(unsigned int pixelformat) const * handlers provied StreamFormats. */ StreamConfiguration::StreamConfiguration() - : memoryType(InternalMemory), stream_(nullptr) + : pixelFormat(0), memoryType(InternalMemory), stream_(nullptr) { } @@ -297,7 +297,8 @@ StreamConfiguration::StreamConfiguration() * \brief Construct a configuration with stream formats */ StreamConfiguration::StreamConfiguration(const StreamFormats &formats) - : memoryType(InternalMemory), stream_(nullptr), formats_(formats) + : pixelFormat(0), memoryType(InternalMemory), stream_(nullptr), + formats_(formats) { }