[libcamera-devel] [PATCH] libcamera: stream: Initialise pixelFormat in StreamConfiguration()
Niklas Söderlund
niklas.soderlund at ragnatech.se
Tue Jul 16 08:18:14 CEST 2019
Hi Laurent,
Thanks for your patch.
On 2019-07-16 09:00:42 +0300, Laurent Pinchart wrote:
> 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 at ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>
> ---
> 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)
> {
> }
>
> --
> Regards,
>
> Laurent Pinchart
>
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel at lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
--
Regards,
Niklas Söderlund
More information about the libcamera-devel
mailing list