From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id EAC2E4693A for ; Sun, 24 Dec 2023 23:26:49 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 614F468D17B; Mon, 25 Dec 2023 01:26:35 +0200 (EET) Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B704168D149 for ; Mon, 25 Dec 2023 01:26:27 +0200 (EET) Received: by mail.gandi.net (Postfix) with ESMTPSA id DE21B1C0003 for ; Sun, 24 Dec 2023 23:26:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1703460387; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:in-reply-to:in-reply-to:references:references; bh=XY/+2metJ5+zJu57Bfp3DqjUJ2FGzyxl3rcrgd0kuZ8=; b=H0m7/Kbn3ArpTQWHKopl2k5r3XITDpcpL6nvgOF4aop4saRVhAuULvI9fnbglWBcmXEhFu igtU1g0/hBYGNOWB4S0h2JGH3PVbRy3nojv13x2vJXu2tRlHeezcWVIvTVdY0XeZqSFOcz mHUQj2dwBXyuIFSqVyJ8e3oUkUcyKXMMWo4TYm0wXY41mpDte5tjbDU9Wq3Zh0s7JTAewO zD+lyx7+zMOpVmi8Nf21Dsjy9bAh+VtefpnTATyAxjuA5JvXVdDgX1lhCgNdF4+TjlwAH4 l3NJ4F9ylG8z52x8Z3+OI7gzl7YASXebuBNlFiuClmW5tKTXX7D7n3wfv4VsJg== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 25 Dec 2023 00:26:23 +0100 Message-Id: <20231224232624.30355-3-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231224232624.30355-1-michael@niedermayer.cc> References: <20231224232624.30355-1-michael@niedermayer.cc> X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 3/4] avfilter/vf_gradfun: Do not overread last line 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 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: The code works in steps of 2 lines and lacks support for odd height Implementing odd height support is better but for now this fixes the out of array access Fixes: out of array access Fixes: tickets/10702/poc6ffmpe Found-by: Zeng Yunxiang Signed-off-by: Michael Niedermayer --- libavfilter/vf_gradfun.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/vf_gradfun.c b/libavfilter/vf_gradfun.c index a71a68ecc16..e8d9cae8286 100644 --- a/libavfilter/vf_gradfun.c +++ b/libavfilter/vf_gradfun.c @@ -92,7 +92,7 @@ static void filter(GradFunContext *ctx, uint8_t *dst, const uint8_t *src, int wi for (y = 0; y < r; y++) ctx->blur_line(dc, buf + y * bstride, buf + (y - 1) * bstride, src + 2 * y * src_linesize, src_linesize, width / 2); for (;;) { - if (y < height - r) { + if (y + 1 < height - r) { int mod = ((y + r) / 2) % r; uint16_t *buf0 = buf + mod * bstride; uint16_t *buf1 = buf + (mod ? mod - 1 : r - 1) * bstride; -- 2.17.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".