[libcamera-devel] [PATCH 3/4] cam: fix use of uninitialized field

Laurent Pinchart laurent.pinchart at ideasonboard.com
Wed Oct 7 15:30:16 CEST 2020


Hi Tomi,

Thank you for the patch.

On Wed, Oct 07, 2020 at 12:22:38PM +0300, Tomi Valkeinen wrote:
> Initialize last_ to 0 to avoid uninitialized use.
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen at iki.fi>

Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>

> ---
>  src/cam/capture.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/cam/capture.cpp b/src/cam/capture.cpp
> index 5510c00..995614a 100644
> --- a/src/cam/capture.cpp
> +++ b/src/cam/capture.cpp
> @@ -17,7 +17,7 @@ using namespace libcamera;
>  
>  Capture::Capture(std::shared_ptr<Camera> camera, CameraConfiguration *config,
>  		 EventLoop *loop)
> -	: camera_(camera), config_(config), writer_(nullptr), loop_(loop),
> +	: camera_(camera), config_(config), writer_(nullptr), last_(0), loop_(loop),
>  	  captureCount_(0), captureLimit_(0)
>  {
>  }

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list