summaryrefslogtreecommitdiff
path: root/src/libcamera/stream.cpp
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-07-16 04:30:47 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-07-16 09:18:42 +0300
commita68cec65c196c24d122026bbc980028cc7d266cc (patch)
tree620be21c2432935a218d2db234b9b1012889f05f /src/libcamera/stream.cpp
parent124336329c11e1fc1687504fc37f67189a44ee2d (diff)
libcamera: stream: Initialise pixelFormat in StreamConfiguration()
To avoid depending on unitialised values, set the pixelFormat field of the StreamConfiguration class to 0 in the constructor. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Diffstat (limited to 'src/libcamera/stream.cpp')
-rw-r--r--src/libcamera/stream.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp
index de505d12..c28b4cd6 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)
{
}