[libcamera-devel] [PATCH 01/10] libcamera: stream: Initialize stride and bufferCount

Jacopo Mondi jacopo at jmondi.org
Tue Jun 2 10:30:29 CEST 2020


Hi Niklas,

On Tue, Jun 02, 2020 at 03:39:00AM +0200, Niklas Söderlund wrote:
> The two public unsigned integer fields of StreamConfiguration, stride
> and bufferCount where not initialized, fix this to match other members
> being initialized to their 'zero' state.
>
> Signed-off-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 f34348f2aea022a0..3c4f64daf69d68a4 100644
> --- a/src/libcamera/stream.cpp
> +++ b/src/libcamera/stream.cpp
> @@ -279,7 +279,7 @@ SizeRange StreamFormats::range(const PixelFormat &pixelformat) const
>   * handlers provied StreamFormats.
>   */
>  StreamConfiguration::StreamConfiguration()
> -	: pixelFormat(0), stream_(nullptr)
> +	: pixelFormat(0), stride(0), bufferCount(0), stream_(nullptr)
>  {
>  }
>
> @@ -287,7 +287,8 @@ StreamConfiguration::StreamConfiguration()
>   * \brief Construct a configuration with stream formats
>   */
>  StreamConfiguration::StreamConfiguration(const StreamFormats &formats)
> -	: pixelFormat(0), stream_(nullptr), formats_(formats)
> +	: pixelFormat(0), stride(0), bufferCount(0), stream_(nullptr),
> +	  formats_(formats)

No need to initialize size as well ?

(this could be a good occasion to re-order StreamConfiguration
declaration in stream.h as fields are declared before functions
there).

Anyway,
Reviewed-by: Jacopo Mondi <jacopo at jmondi.org>

Thanks
  j

>  {
>  }
>
> --
> 2.26.2
>
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel at lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel


More information about the libcamera-devel mailing list