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 EE16E477FD for ; Fri, 22 Dec 2023 21:45:19 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0E1CD68D2E1; Fri, 22 Dec 2023 23:45:11 +0200 (EET) Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id ACA3468D280 for ; Fri, 22 Dec 2023 23:45:04 +0200 (EET) Received: by mail.gandi.net (Postfix) with ESMTPSA id 128BFE0002 for ; Fri, 22 Dec 2023 21:45:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1703281504; 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=RsLgrQ4Ima3jMHDAtL3Wge0uOKW65u2XGQhWd6QNykI=; b=Z8MODwGBWd9hgdLYsY3Pvye3XpkZZpmwgduP7E0Cyt3XELw+k9kfsNpJ55dtXMD5RhCKFn u1Ut47eIFYBFX6pS2d3AKl1r+oXhL1B1+WeLcaSpup58Chb1ixzbRUJo56A4xmbtizjt5r l0w+ejBue4cEM0wUomAWMiSH14gbma03VnpgndUssVArhGyR5Tvn8fm+SCdua46Kb0soOK ZXeCpxfS/unTLpiCeJunZHDwdW8e00GindpGC3GMEuhm+mc7hBjG8MOojufbcSCdoWd/Aq vyl5qU8eyYJzmyjoJycQNbUsTeL46LN4xQ98q5vSkwNc/svkxlHnVoVIvLz+Kw== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 22 Dec 2023 22:45:00 +0100 Message-Id: <20231222214502.24596-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231222214502.24596-1-michael@niedermayer.cc> References: <20231222214502.24596-1-michael@niedermayer.cc> X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 2/4] avfilter/vf_swaprect: assert that rectangles are within memory 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: Signed-off-by: Michael Niedermayer --- libavfilter/vf_swaprect.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavfilter/vf_swaprect.c b/libavfilter/vf_swaprect.c index 13ae149afdb..8a983b605bf 100644 --- a/libavfilter/vf_swaprect.c +++ b/libavfilter/vf_swaprect.c @@ -18,6 +18,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "libavutil/avassert.h" #include "libavutil/avstring.h" #include "libavutil/eval.h" #include "libavutil/imgutils.h" @@ -182,6 +183,10 @@ FF_ENABLE_DEPRECATION_WARNINGS y2[1] = y2[2] = AV_CEIL_RSHIFT(y2[0], s->desc->log2_chroma_h); y2[0] = y2[3] = y2[0]; + + av_assert0(FFMAX(x1[1], x2[1]) + pw[1] <= lw[1]); + av_assert0(FFMAX(y1[1], y2[1]) + ph[1] <= lh[1]); + for (p = 0; p < s->nb_planes; p++) { if (ph[p] == ah[p] && pw[p] == aw[p]) { uint8_t *src = in->data[p] + y1[p] * in->linesize[p] + x1[p] * s->pixsteps[p]; -- 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".