[libcamera-devel] [PATCH] android: camera_capabilities: Ensure PixelArrayActiveAreas exists before accessing

Laurent Pinchart laurent.pinchart at ideasonboard.com
Thu Jul 15 16:06:09 CEST 2021


Hi Kieran,

Thank you for the patch.

On Thu, Jul 15, 2021 at 03:00:11PM +0100, Kieran Bingham wrote:
> The VIVID pipline handler does not set this. It's likely that the
> UVC pipeline will not either.
> 
> If not present, we must not access it.

Wasn't this considered as a mandatory property ?

> Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
> ---
>  src/android/camera_capabilities.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp
> index 6b5edb66fad2..dfc961affe46 100644
> --- a/src/android/camera_capabilities.cpp
> +++ b/src/android/camera_capabilities.cpp
> @@ -589,7 +589,7 @@ int CameraCapabilities::initializeStaticMetadata()
>  					  physicalSize);
>  	}
>  
> -	{
> +	if (properties.contains(properties::PixelArrayActiveAreas)) {
>  		const Span<const Rectangle> &rects =
>  			properties.get(properties::PixelArrayActiveAreas);
>  		std::vector<int32_t> data{

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list