[libcamera-devel] [PATCH 5/5] libcamera: MappedBuffer: Delete copy and assignment

Laurent Pinchart laurent.pinchart at ideasonboard.com
Fri Oct 23 06:41:06 CEST 2020


Hi Kieran,

Thank you for the patch.

On Thu, Oct 22, 2020 at 02:56:05PM +0100, Kieran Bingham wrote:
> Prevent copying and assignment of MappedBuffer types, which could invoke unmapping
> or mapped memory.

Line wrap ?

> Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>

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

> ---
>  include/libcamera/internal/buffer.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/include/libcamera/internal/buffer.h b/include/libcamera/internal/buffer.h
> index b7b0173f93f5..8c7126482b95 100644
> --- a/include/libcamera/internal/buffer.h
> +++ b/include/libcamera/internal/buffer.h
> @@ -10,6 +10,7 @@
>  #include <sys/mman.h>
>  #include <vector>
>  
> +#include <libcamera/class.h>
>  #include <libcamera/buffer.h>
>  #include <libcamera/span.h>
>  
> @@ -34,6 +35,9 @@ protected:
>  
>  	int error_;
>  	std::vector<Plane> maps_;
> +
> +private:
> +	DELETE_COPY_AND_ASSIGN(MappedBuffer);
>  };
>  
>  class MappedFrameBuffer : public MappedBuffer

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list