From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 9BFF2461D0 for ; Mon, 14 Jul 2025 22:15:03 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 334ED68F03A; Tue, 15 Jul 2025 01:15:00 +0300 (EEST) Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 30B3F68EC97 for ; Tue, 15 Jul 2025 01:14:54 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 5CC8241C7D for ; Mon, 14 Jul 2025 22:14:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1752531293; 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=cTURhkvPOv6ScNx3cXPQppldAKFuYb3kITK7dAfMaec=; b=Uq6LS2L6sql+cLm7LiMk5UkkJxDsFHJAK5yUZl0E9gfL8cGnKKXQyb+uAt2uTCRMotTgjZ izlG3sE+jHiKuhiIruI/hujZltDoff/FlSFkJegbVSArpOryg74a7he38oRHN2iO6MyOwR xSe5E8C9dpMslbTpTcaUGR6sRiccJg60nLQF8xwlckD1nldmp1swrFYQni2XtRGbCegzlJ 8Ww/lpYmciyHwCNpmIbpvZDan2MpBjsaEGTal2C7VMj2IVBwmJ9NNSBCZM6NTmrGDGcYqO WRXg2sz1GON2QHejsoPKvodjy2DIrLxi6BkUWQ7yXjCBYW1jLqkRk3d3C/+ncA== Date: Tue, 15 Jul 2025 00:14:51 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20250714221451.GQ29660@pb2> References: <20250713230152.8373-1-jamrial@gmail.com> MIME-Version: 1.0 In-Reply-To: <20250713230152.8373-1-jamrial@gmail.com> X-GND-State: clean X-GND-Score: -85 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgdehfeduvdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrhhlucfvnfffucdludehmdenucfjughrpeffhffvuffkfhggtggujgesghdtreertddtvdenucfhrhhomhepofhitghhrggvlhcupfhivgguvghrmhgrhigvrhcuoehmihgthhgrvghlsehnihgvuggvrhhmrgihvghrrdgttgeqnecuggftrfgrthhtvghrnhepieegkedtjeduffejhfetgeejtdegteetgfegtdfhjefgvefhteegkeejtddvhfevnecukfhppeeguddrieeirdeihedrudejieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeeguddrieeirdeihedrudejiedphhgvlhhopehlohgtrghlhhhoshhtpdhmrghilhhfrhhomhepmhhitghhrggvlhesnhhivgguvghrmhgrhigvrhdrtggtpdhnsggprhgtphhtthhopedupdhrtghpthhtohepfhhfmhhpvghgqdguvghvvghlsehffhhmphgvghdrohhrgh X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH] avcodec/motion_est: don't add offsets to NULL pointers 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 Content-Type: multipart/mixed; boundary="===============2711503346709157266==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============2711503346709157266== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="yWDGhW75IDr8xNHK" Content-Disposition: inline --yWDGhW75IDr8xNHK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jul 13, 2025 at 08:01:52PM -0300, James Almer wrote: > Fixes: libavcodec/motion_est.c:94:31: runtime error: applying zero offset= to null pointer > Signed-off-by: James Almer > --- > libavcodec/motion_est.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) >=20 > diff --git a/libavcodec/motion_est.c b/libavcodec/motion_est.c > index 93be712cc0..bde4591bf7 100644 > --- a/libavcodec/motion_est.c > +++ b/libavcodec/motion_est.c > @@ -90,12 +90,14 @@ static inline void init_ref(MotionEstContext *c, uint= 8_t *const src[3], > ((y*c->uvstride + x)>>1), > }; > int i; > - for(i=3D0; i<3; i++){ > + for (i =3D 0; i < 3 && src[i]; i++) { > c->src[0][i]=3D src [i] + offset[i]; > + } > + for (i =3D 0; i < 3 && ref[i]; i++) { > c->ref[0][i]=3D ref [i] + offset[i]; > } > if(ref_index){ > - for(i=3D0; i<3; i++){ > + for (i =3D 0; i < 3 && ref2[i]; i++) { > c->ref[ref_index][i]=3D ref2[i] + offset[i]; > } > } I think the destination should be initialized to NULL when source is NULL. But i didnt check if it makes a difference, just from looking at this thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Concerning the gods, I have no means of knowing whether they exist or not or of what sort they may be, because of the obscurity of the subject, and the brevity of human life -- Protagoras --yWDGhW75IDr8xNHK Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCaHWBWAAKCRBhHseHBAsP q5R9AJ9ARggxg8+ZkkxGSSO2H0mlxswf/ACgipLSdpONPNEJFSnMH9iJ5cNe4HQ= =XbEM -----END PGP SIGNATURE----- --yWDGhW75IDr8xNHK-- --===============2711503346709157266== 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". --===============2711503346709157266==--