From patchwork Mon Jul 8 22:24:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 50422 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:612c:fad:b0:482:c625:d099 with SMTP id kf13csp29100vqb; Mon, 8 Jul 2024 15:24:50 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV0ASWY/MqNK7w8Z6cMiOPcHMJapr5YUYZvY8XfdXG/DWaCdKtxS0csek8EXjRa3n+KVyfJv4M0wRWl8aMYFPrWWxwZ9dS13O4uxw== X-Google-Smtp-Source: AGHT+IGWCGK56r3H0AfRKpXH71e9yXwq2aKnFAkncZhH6EbW2ACLW2uQa7j1LuQggJ8VGTPDK+PG X-Received: by 2002:a50:8751:0:b0:57c:5ec6:1466 with SMTP id 4fb4d7f45d1cf-594bb9605b4mr403482a12.25.1720477490481; Mon, 08 Jul 2024 15:24:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1720477490; cv=none; d=google.com; s=arc-20160816; b=gLQ3WWPHSl+rbiu53euPujgB2m3rdQS86vPkliliv/uYUt2oH54wQk0xXxTMH1ieiv 9MVwjBKwp4RMnsQEfz2SIFWV7uPLuWFyzaCIki9GoM1r0RQxXeP+RxRlv7aB0od3KnZ0 KKg3AayyXeiyDncAtC4pEx4fIMBpFpvl3Uyah0NMMiLSsFcY3Ryu6ICp8Yfeb8aFA5qJ sqjwGbm99HzbyXs79vxiaFAeBwsN+wNPzOvALwlY9XqDPY6ssVFeSIAp21998i9Ul5v/ x/WbNF9vXVd1zjW+OVSTUCAYFero1X8wdabMuNeDoGzWuGMn0quxbsNVkeis5qOBNq1l cPRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=krl/5QYcRr+9yIebT/sOHXR8VkVIqizOXcXyCqhkZ2Y=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=b8Gm1CiCqX3v+a812ps3cnDNB58pi7/Aj0Kz1sjuxkCzbzM4lIc1+yy5CaCS7tYjEm HRpWDcPKr42zhFCGpkjwEkAtamt5lMy2R0YE1GVdeLNp5/0orCiKX1SWqZ9xMzuterFt fzkTJgiDHNr7evCebMQ/9Pw79cRJDueKF8JsnDFxHI1SnZL3+oyX2C1yrt4qiYmf9qyM KvlpAVulWp/JU62l+pDuCv36xR/qJWYvzBJshvr/DY7IGvfkKQc/RV3oOS1ql7THpBWn 0gVYILjCb+WieHGlAdbxB3oJ5hI+MoFPKShlP1LYAXfWJ78h1P86ddf0Y/darpjbDuvM +A7Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@niedermayer.cc header.s=gm1 header.b=DqnoOHMO; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 4fb4d7f45d1cf-594bdf55ad7si284430a12.433.2024.07.08.15.24.50; Mon, 08 Jul 2024 15:24:50 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@niedermayer.cc header.s=gm1 header.b=DqnoOHMO; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3E44668DCA2; Tue, 9 Jul 2024 01:24:27 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6888E68DC13 for ; Tue, 9 Jul 2024 01:24:16 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id C6A87FF802 for ; Mon, 8 Jul 2024 22:24:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1720477455; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Fa55Hc43RH8T10FtPumNhRpSmWqY2OWo5C6FIZqibdo=; b=DqnoOHMOpN9UQr7nXKuhqlsjlngD8HPDbTFphA60MsFnLBvtZfihUEygcL61XusmdVjMJ+ RcsfpVzlb49jO2vzC9HrtlPxw1NKAp33DwjhEZRCE+OrFFD92pNsdZTtQU5gW6arFLPhL0 b+KJsOcqnaLAiyGnLuGX7uW7hDjJfmSFme0DY/t+gOD0mptHNtQe/CUwtkF8d36chEBlqf 4lqT7tIegLd3R8Ddvny7FlmIQaq7yWYGx0+Fsww8rbeix1x261tmhN2IFf/+TWm3QTIUiL QJViC94bJdan3nsOXJNy9NL1h4SlGyY6wMCP3VV+hvyOU6gS9zY4G7KedVUPig== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Tue, 9 Jul 2024 00:24:06 +0200 Message-ID: <20240708222410.773456-4-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240708222410.773456-1-michael@niedermayer.cc> References: <20240708222410.773456-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 4/8] avfilter/vf_neighbor_opencl: Use AV_PIX_MAX_PLANES X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: ZscfDAgiJAyl Fix/Robustness/whatever: CID1439575 Out-of-bounds read Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavfilter/vf_neighbor_opencl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavfilter/vf_neighbor_opencl.c b/libavfilter/vf_neighbor_opencl.c index b2939f841a2..ba661bd665e 100644 --- a/libavfilter/vf_neighbor_opencl.c +++ b/libavfilter/vf_neighbor_opencl.c @@ -42,7 +42,7 @@ typedef struct NeighborOpenCLContext { char *matrix_str[4]; - cl_float threshold[4]; + cl_float threshold[AV_VIDEO_MAX_PLANES]; cl_int coordinates; cl_mem coord; @@ -93,7 +93,7 @@ static int neighbor_opencl_make_filter_params(AVFilterContext *avctx) cl_int cle; int i; - for (i = 0; i < 4; i++) { + for (i = 0; i < AV_VIDEO_MAX_PLANES; i++) { ctx->threshold[i] /= 255.0; }