From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <ffmpeg-devel-bounces@ffmpeg.org> Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id C5A914BF48 for <ffmpegdev@gitmailbox.com>; Tue, 1 Apr 2025 00:28:52 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 78237687B57; Tue, 1 Apr 2025 03:28:48 +0300 (EEST) Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DEE65687CAA for <ffmpeg-devel@ffmpeg.org>; Tue, 1 Apr 2025 03:28:41 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 4A19D44164 for <ffmpeg-devel@ffmpeg.org>; Tue, 1 Apr 2025 00:28:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1743467321; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=HM9mHs6gpWlP67mIWoGI5usMaOLrYm77C6jN19H4O90=; b=XSYXUXA1Nf+ZfGnHHorNYOTT4Fm2l1BFCI6N4NnxPUEygXrcPW0SAQIkZ4cmlC/b8OXdMg cJd5rXVTlDjx74seI5nHZY3xErPn9d44kjj9gM1MZiO1UA+kWax+w2tjjxMCVId/tRnhY/ RF8RSNaSTUHkjQBCFZOIuYWqhjkEw3JBJgi0keCwrNlfxtgDSeIxmk5cmmtR+jEYQNBVIo gvOFGWKU8r198tqVYmX76/R2R0kHkv4M7GvJZ+r+vQ2K7RP+8uqKakNbrf7Y1Ce4IPunBp S5vMEd4cQEivmRlPaq0P9IXw8c6r20bn2Sdnde4rvZ09Ai8Ollh1T8Af8RCblQ== Date: Tue, 1 Apr 2025 02:28:40 +0200 From: Michael Niedermayer <michael@niedermayer.cc> To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Message-ID: <20250401002840.GF4991@pb2> References: <20250326103015.44296-1-martin@martin.st> <20250326103015.44296-2-martin@martin.st> <20250329001510.GO4991@pb2> <2642b04-6ac-a238-c3f2-1551a5e5d4c@martin.st> MIME-Version: 1.0 In-Reply-To: <2642b04-6ac-a238-c3f2-1551a5e5d4c@martin.st> X-GND-State: clean X-GND-Score: -70 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddukedufeeiucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfghrlhcuvffnffculdeftddmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredttddunecuhfhrohhmpefoihgthhgrvghlucfpihgvuggvrhhmrgihvghruceomhhitghhrggvlhesnhhivgguvghrmhgrhigvrhdrtggtqeenucggtffrrghtthgvrhhnpedutedvhfduuedugedufefghefhvedvgffgffekhfdvgfdvtefftdejkeehteefheenucfkphepgedurdeiiedrieejrdduudefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepgedurdeiiedrieejrdduudefpdhhvghloheplhhotggrlhhhohhsthdpmhgrihhlfhhrohhmpehmihgthhgrvghlsehnihgvuggvrhhmrgihvghrrdgttgdpnhgspghrtghpthhtohepuddprhgtphhtthhopehffhhmphgvghdquggvvhgvlhesfhhfmhhpvghgrdhorhhg X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH 2/4] checkasm: Implement helpers for defining and checking padded rects X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches <ffmpeg-devel.ffmpeg.org> List-Unsubscribe: <https://ffmpeg.org/mailman/options/ffmpeg-devel>, <mailto:ffmpeg-devel-request@ffmpeg.org?subject=unsubscribe> List-Archive: <https://ffmpeg.org/pipermail/ffmpeg-devel> List-Post: <mailto:ffmpeg-devel@ffmpeg.org> List-Help: <mailto:ffmpeg-devel-request@ffmpeg.org?subject=help> List-Subscribe: <https://ffmpeg.org/mailman/listinfo/ffmpeg-devel>, <mailto:ffmpeg-devel-request@ffmpeg.org?subject=subscribe> Reply-To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Content-Type: multipart/mixed; boundary="===============8732067634379054644==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" <ffmpeg-devel-bounces@ffmpeg.org> Archived-At: <https://master.gitmailbox.com/ffmpegdev/20250401002840.GF4991@pb2/> List-Archive: <https://master.gitmailbox.com/ffmpegdev/> List-Post: <mailto:ffmpegdev@gitmailbox.com> --===============8732067634379054644== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="gOMBpgTpcepbR4Lc" Content-Disposition: inline --gOMBpgTpcepbR4Lc Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Martin On Mon, Mar 31, 2025 at 04:05:27PM +0300, Martin Storsj=F6 wrote: > On Sat, 29 Mar 2025, Michael Niedermayer wrote: >=20 > > On Wed, Mar 26, 2025 at 12:30:13PM +0200, Martin Storsj=F6 wrote: > > > This backports similar functionality from dav1d, from commits > > > 35d1d011fda4a92bcaf42d30ed137583b27d7f6d and > > > d130da9c315d5a1d3968d278bbee2238ad9051e7. > > >=20 > > > This allows detecting writes out of bounds, on all 4 sides of > > > the intended destination rectangle. > > >=20 > > > The bounds checking also can optionally allow small overwrites > > > (up to a specified alignment), while still checking for larger > > > overwrites past the intended allowed region. > > > --- > > > tests/checkasm/checkasm.c | 89 ++++++++++++++++++++++++++++++-------= -- > > > tests/checkasm/checkasm.h | 55 ++++++++++++++++++++---- > > > 2 files changed, 116 insertions(+), 28 deletions(-) > > >=20 > > > diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c > > > index c6d641c52b..a5b862fe52 100644 > > > --- a/tests/checkasm/checkasm.c > > > +++ b/tests/checkasm/checkasm.c > > > @@ -1168,37 +1168,88 @@ void checkasm_report(const char *name, ...) > > > } > > > } > > >=20 > > > +static int check_err(const char *file, int line, > > > + const char *name, int w, int h, > > > + int *err) > > > +{ > > > + if (*err) > > > + return 0; > > > + if (!checkasm_fail_func("%s:%d", file, line)) > > > + return 1; > > > + *err =3D 1; > > > + fprintf(stderr, "%s (%dx%d):\n", name, w, h); > > > + return 0; > > > +} > > > + > > > #define DEF_CHECKASM_CHECK_FUNC(type, fmt) \ > > > int checkasm_check_##type(const char *file, int line, \ > > > const type *buf1, ptrdiff_t stride1, \ > > > const type *buf2, ptrdiff_t stride2, \ > > > - int w, int h, const char *name) \ > > > + int w, int h, const char *name, \ > > > + int align_w, int align_h, \ > > > + int padding) \ > > > { \ > >=20 > > > + int aligned_w =3D (w + align_w - 1) & ~(align_w - 1); \ > > > + int aligned_h =3D (h + align_h - 1) & ~(align_h - 1); \ > >=20 > > this can overflow > > feel free to fix in a seperate patch >=20 > Feel free to propose a patch for how you'd prefer to have it fixed then..= =2E I > don't see this as a real world problem - w and h are bounded by the tests > themselves, and likewise the alignments - I don't see us having tests usi= ng > buffers with a width near INT32_MAX? maybe but then if we want our asm code to handle such extrem cases, something needs to test it ill send a patch based on this: (once your patches are in / minus in case i forget) int64_t aligned_w =3D (w - 1LL + align_w) & ~(align_w - 1); \ if (aligned_w !=3D (int32_t)aligned_w) return AVERROR(EINVAL) thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB While the State exists there can be no freedom; when there is freedom there will be no State. -- Vladimir Lenin --gOMBpgTpcepbR4Lc Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZ+szMQAKCRBhHseHBAsP q3N0AJ9URgjfiZY8nqj63O1iMSUjQKJ8rwCfQispNT18zFChhpEc5O8Qbb2cY98= =v8K+ -----END PGP SIGNATURE----- --gOMBpgTpcepbR4Lc-- --===============8732067634379054644== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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". --===============8732067634379054644==--