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 E99D240EA2 for ; Wed, 9 Feb 2022 09:36:11 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id EDE2868B1D4; Wed, 9 Feb 2022 11:36:08 +0200 (EET) 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 DB69F68B0B6 for ; Wed, 9 Feb 2022 11:36:01 +0200 (EET) Received: from localhost (213-47-68-29.cable.dynamic.surfer.at [213.47.68.29]) (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id E9459FF803 for ; Wed, 9 Feb 2022 09:36:00 +0000 (UTC) Date: Wed, 9 Feb 2022 10:36:00 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20220209093600.GT2829255@pb2> References: <20220208205032.2013-1-michael@niedermayer.cc> MIME-Version: 1.0 In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH] avcodec/motion_est: Fix xy indexing on range violation in ff_get_best_fcode() 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="===============7890756721915425674==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============7890756721915425674== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="N8uhgasHSXhV9xCN" Content-Disposition: inline --N8uhgasHSXhV9xCN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Feb 09, 2022 at 03:39:20AM +0100, Andreas Rheinhardt wrote: > Michael Niedermayer: > > This codepath seems untested, no testcases change > >=20 > > Found-by: > > Signed-off-by: Michael Niedermayer > > --- > > libavcodec/motion_est.c | 8 +++++--- > > 1 file changed, 5 insertions(+), 3 deletions(-) > >=20 > > diff --git a/libavcodec/motion_est.c b/libavcodec/motion_est.c > > index 9c548c1567..4cf1afe888 100644 > > --- a/libavcodec/motion_est.c > > +++ b/libavcodec/motion_est.c > > @@ -1621,9 +1621,11 @@ int ff_get_best_fcode(MpegEncContext * s, int16_= t (*mv_table)[2], int type) > > fcode_tab[my + MAX_MV]); > > int j; > > =20 > > - if(mx >=3D range || mx < -range || > > - my >=3D range || my < -range) > > - continue; > > + if (mx >=3D range || mx < -range || > > + my >=3D range || my < -range) { > > + xy++; > > + continue; > > + } > > =20 > > for(j=3D0; j > if(s->pict_type=3D=3DAV_PICTURE_TYPE_B || s->c= urrent_picture.mc_mb_var[xy] < s->current_picture.mb_var[xy]) >=20 > It would be simpler if you added the xy++ to the outer-for-loop and > removed the other xy++. that leaves the indention wrong. Will move the xy in the for loop and fix the indention in a separate commit thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB When you are offended at any man's fault, turn to yourself and study your own failings. Then you will forget your anger. -- Epictetus --N8uhgasHSXhV9xCN Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCYgOK+wAKCRBhHseHBAsP q39wAJ9EIstOA7VKIxsl0BSSZ4AB1ZwHMACdFZLvfMyMTYOmYh6AMtN9m/3f3C4= =QSuT -----END PGP SIGNATURE----- --N8uhgasHSXhV9xCN-- --===============7890756721915425674== 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". --===============7890756721915425674==--