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>
This commit is contained in:
Laurent Pinchart 2019-07-16 04:30:47 +03:00
parent 124336329c
commit a68cec65c1

View file

@ -289,7 +289,7 @@ SizeRange StreamFormats::range(unsigned int pixelformat) const
* handlers provied StreamFormats. * handlers provied StreamFormats.
*/ */
StreamConfiguration::StreamConfiguration() 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 * \brief Construct a configuration with stream formats
*/ */
StreamConfiguration::StreamConfiguration(const StreamFormats &formats) StreamConfiguration::StreamConfiguration(const StreamFormats &formats)
: memoryType(InternalMemory), stream_(nullptr), formats_(formats) : pixelFormat(0), memoryType(InternalMemory), stream_(nullptr),
formats_(formats)
{ {
} }