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 DA8714AA27 for ; Tue, 7 May 2024 17:46:38 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4D30E68D72D; Tue, 7 May 2024 20:46:36 +0300 (EEST) Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5475268D41E for ; Tue, 7 May 2024 20:46:30 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 885FA1BF205 for ; Tue, 7 May 2024 17:46:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1715103989; 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=FuM/PHKR5KGG8pvI1QQBYLiR7fljrG2kCKLBTk6TLYQ=; b=M19QtiX92ttUJ4XQwGq6IlMX5L3HdzVTk3fRylwCJdGu1kep02EwHbEX1DVm7OPmHzfwwy cm2qjSX6/ndN3LJ8P7i0eNpANP5vOUZMqCtv9uCKYnBygSJTNRyIhRsDbDhfvSAcH5zfSt R3glmJHa/+ed9M2ieh36S0LV9WfEd09A/rrEa3AtSTRvwkfORciRLAZdceh4LIrQaXxg+I gJmGgm8b7NIqsUL66QWdvzR/9OYh14W5773vSM6U+2KLiYR1rSP84E2UJreDPcSd5D8lhE 4ncwAHwjbJW5yeySlWSCAb6NruRxaV1NCveunFRWz6H50DpzNx25+p2O8go1iA== Date: Tue, 7 May 2024 19:46:28 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20240507174628.GF6420@pb2> References: <20240505223040.521838-1-gerion.entrup@flump.de> MIME-Version: 1.0 In-Reply-To: <20240505223040.521838-1-gerion.entrup@flump.de> X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH 1/2] libavfilter/signature_lookup: fix possible division by zero 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="===============4874278146578515689==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============4874278146578515689== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="X1Z1h1QjSZ6/4YGi" Content-Disposition: inline --X1Z1h1QjSZ6/4YGi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 06, 2024 at 12:30:39AM +0200, Gerion Entrup wrote: > --- > libavfilter/signature_lookup.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/libavfilter/signature_lookup.c b/libavfilter/signature_looku= p.c > index a0ca818a9b..b39a3e225b 100644 > --- a/libavfilter/signature_lookup.c > +++ b/libavfilter/signature_lookup.c > @@ -128,7 +128,7 @@ static int get_jaccarddist(SignatureContext *sc, Coar= seSignature *first, CoarseS > int jaccarddist, i, composdist =3D 0, cwthcount =3D 0; > for (i =3D 0; i < 5; i++) { > if ((jaccarddist =3D intersection_word(first->data[i], second->d= ata[i])) > 0) { > - jaccarddist /=3D union_word(first->data[i], second->data[i]); > + jaccarddist /=3D FFMAX(union_word(first->data[i], second->da= ta[i]), 1); > } for which input data does this cause a division by 0 ? thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB I am the wisest man alive, for I know one thing, and that is that I know nothing. -- Socrates --X1Z1h1QjSZ6/4YGi Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZjpo8QAKCRBhHseHBAsP q408AJ937oT3pzkcbNHeBJJeT5SG/8TOTgCgnBJ0QmrE0Ln7PfUc1OJyP3sVQB0= =qAIu -----END PGP SIGNATURE----- --X1Z1h1QjSZ6/4YGi-- --===============4874278146578515689== 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". --===============4874278146578515689==--