From patchwork Thu Feb 11 13:34:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 11244 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 5A755BD162 for ; Thu, 11 Feb 2021 13:34:54 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B83626374C; Thu, 11 Feb 2021 14:34:53 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="p0clltTY"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A72C96373E for ; Thu, 11 Feb 2021 14:34:49 +0100 (CET) Received: from Q.local (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 522921231; Thu, 11 Feb 2021 14:34:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1613050489; bh=tiUgSTDGAJdFfObIjl6SLnN7J2AUgSIKWMC6P0sKttk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p0clltTYQG4uZOelRLB1O8w248ZW2ahZfYO56QeDiLU6edAvYN6GfZkesb7bNbkN7 8OpTduys4bAk+zPNuU/ozRIRosQ10Zo5Bb3VhAr5mcDw1wabRW6tWHLxK+pyGiAroZ r6i9ATPDpD9ktWQ+FwsOLtQyaEvRwboNt2EHPc2U= From: Kieran Bingham To: libcamera devel Date: Thu, 11 Feb 2021 13:34:44 +0000 Message-Id: <20210211133444.764808-7-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210211133444.764808-1-kieran.bingham@ideasonboard.com> References: <20210211133444.764808-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 6/6] libcamera: MappedBuffer: Disable copy and assignment X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Prevent copying and assignment of MappedBuffer types, which could invoke undesired unmapping of mapped memory. Signed-off-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- 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..b980deaf58d5 100644 --- a/include/libcamera/internal/buffer.h +++ b/include/libcamera/internal/buffer.h @@ -10,6 +10,7 @@ #include #include +#include #include #include @@ -34,6 +35,9 @@ protected: int error_; std::vector maps_; + +private: + LIBCAMERA_DISABLE_COPY(MappedBuffer); }; class MappedFrameBuffer : public MappedBuffer