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 323514A12F for ; Mon, 22 Apr 2024 02:09:48 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 901E868D2A1; Mon, 22 Apr 2024 05:09:45 +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 2A58668CA42 for ; Mon, 22 Apr 2024 05:09:39 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 76D411BF203 for ; Mon, 22 Apr 2024 02:09:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1713751778; 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=HZWv7fM4CmA74YAXpEWvqTHsUdA0eLoLJdGwQar7dA0=; b=Mo5Ia93eD1ebcO5trQ+yS+6sKcmOoLdHK8ckHJfitCmelH9SKLSwUQdvD43G0ErBWhNphI I4hzEE6Gw/Q8VWu/Uz7mz9wkBq4PML+JJ8da9yoEXbfDJvQlQ/QxHgExE2R9sWIZaPJcwf IaRs5o9Gk3kmNOyELkYXtuoPq1OAeWfeO6T+cEe02EeStE6ekFdLAXzBtWHBizpPA52ztC 1gD1H7mJ9ycybgIE4csDabuzlPMKV0H7/2cbnbwis1rURWvXx3aSXBIjQGlZiTZ40eXOc1 X888RXud1rkpUTEC08WPFylQ8UX7v+lnepu5nQk/Tv3enVyxgbzl+twBf8XqiQ== Date: Mon, 22 Apr 2024 04:09:37 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20240422020937.GB6420@pb2> References: <20240421230701.4178782-1-michael@niedermayer.cc> <20240421230701.4178782-2-michael@niedermayer.cc> MIME-Version: 1.0 In-Reply-To: X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH 2/3] avfilter/signature_lookup: Initialize bestmatch 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="===============8917909923377132788==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============8917909923377132788== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="oc2dZ8QmL9YDPCT7" Content-Disposition: inline --oc2dZ8QmL9YDPCT7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 22, 2024 at 01:10:47AM +0200, Andreas Rheinhardt wrote: > Michael Niedermayer: > > Fixes: CID1500345 Uninitialized scalar variable > >=20 > > Sponsored-by: Sovereign Tech Fund > > Signed-off-by: Michael Niedermayer > > --- > > libavfilter/signature_lookup.c | 4 +--- > > 1 file changed, 1 insertion(+), 3 deletions(-) > >=20 > > diff --git a/libavfilter/signature_lookup.c b/libavfilter/signature_loo= kup.c > > index a3086b38cca..dc0a2ef2b24 100644 > > --- a/libavfilter/signature_lookup.c > > +++ b/libavfilter/signature_lookup.c > > @@ -535,16 +535,14 @@ static MatchingInfo lookup_signatures(AVFilterCon= text *ctx, SignatureContext *sc > > { > > CoarseSignature *cs, *cs2; > > MatchingInfo *infos; > > - MatchingInfo bestmatch; > > + MatchingInfo bestmatch =3D {0}; > > MatchingInfo *i; > > =20 > > cs =3D first->coarsesiglist; > > cs2 =3D second->coarsesiglist; > > =20 > > /* score of bestmatch is 0, if no match is found */ > > - bestmatch.score =3D 0; > > bestmatch.meandist =3D 99999; > > - bestmatch.whole =3D 0; > > =20 > > fill_l1distlut(sc->l1distlut); > > =20 >=20 > Does this fix an actual bug or just suppress a Coverity warning? returning partially initialized structs is IMHO bad practice it is strictly not a bug i guess. But its similar to not initializing pointers to NULL and then having to track if all paths initialize them before freeing. This is similar. With passing partially initialized structs around, one would have to ensure that nothing is touched that isnt initialized. Ive marked the issue as false positive now as that is in fact more correct. thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Complexity theory is the science of finding the exact solution to an approximation. Benchmarking OTOH is finding an approximation of the exact --oc2dZ8QmL9YDPCT7 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZiXG3QAKCRBhHseHBAsP q5pjAKCPhVb0NvSvgFFYk4dwxUn4KrsJ3QCeOhJygkxQCNPBi/av19y/eWiAiz8= =CIly -----END PGP SIGNATURE----- --oc2dZ8QmL9YDPCT7-- --===============8917909923377132788== 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". --===============8917909923377132788==--