From patchwork Fri Jun 13 14:37:19 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 23562 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 A24A2BDE6B for ; Fri, 13 Jun 2025 14:37:25 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 90D2968DBE; Fri, 13 Jun 2025 16:37:24 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Me8D864H"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id AD86668DB4 for ; Fri, 13 Jun 2025 16:37:22 +0200 (CEST) Received: from pb-laptop.local (185.221.143.107.nat.pool.zt.hu [185.221.143.107]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 1DB0BED for ; Fri, 13 Jun 2025 16:37:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1749825433; bh=Z2bqb7uXmHIDN9oo4SUmy/nJK0knNTeRQZlE681uTKA=; h=From:To:Subject:Date:From; b=Me8D864HYDYLVOOse6sApDEEAJKHDsmQDMZBxyc41p6JqYijaFVzLt+CZbJSXDc+B O8dystiIs72TXDnPzMQYNZ0GPJD4fe2nlRZk/y6fsB2gBYmexsfwWObRYzNsNrQsxz FbVH4s2zDQhSaoyaAJ7iH/7BPxVYInnoumIwv9fg= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [PATCH v1] apps: common: image: Fix assertion Date: Fri, 13 Jun 2025 16:37:19 +0200 Message-ID: <20250613143719.1131707-1-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.49.0 MIME-Version: 1.0 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" `plane` must be strictly less than the vector's size, it cannot be equal to it. Signed-off-by: Barnabás Pőcze Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- src/apps/common/image.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/apps/common/image.cpp b/src/apps/common/image.cpp index a2a0f58f3..9a67238aa 100644 --- a/src/apps/common/image.cpp +++ b/src/apps/common/image.cpp @@ -98,12 +98,12 @@ unsigned int Image::numPlanes() const Span Image::data(unsigned int plane) { - assert(plane <= planes_.size()); + assert(plane < planes_.size()); return planes_[plane]; } Span Image::data(unsigned int plane) const { - assert(plane <= planes_.size()); + assert(plane < planes_.size()); return planes_[plane]; }