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 AD10E4AA9E for ; Sun, 12 May 2024 00:19:01 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3482968D467; Sun, 12 May 2024 03:18:59 +0300 (EEST) Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D44A668D334 for ; Sun, 12 May 2024 03:18:51 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 413AEE0002 for ; Sun, 12 May 2024 00:18:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1715473131; 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=REK+HrXWbHfM6KQW/XbLR6Pz0DWGz+4+dyjvOwRdywQ=; b=nWp67mHUbBGWFGjJ5pRb1JTaf5pvWYVArORkXxOBHgR0/OxJIGBlBl56O2Ee6ibfZow92a GlB05c1nIHDWL2zW5WtZzYt2HSW9bi8mLwDF74Cay5Znxf7EzeJ8hA8SLFtZMwjoaptPkO D2RvmhvmV5t+DwmJ7pD6I/RjmptsOO/m4eZ7SDhrdR3XaXVltrzwiemNkWqqlU/M/Vi4mF 3aww1nAZaZR7XA/aBaJC3i7ka6qpAUUgmqdAiOeSpSyf2VebRIy6PmZsW2YXyCDZRumhWe e41V/DwCMZtAwqG1Zs00FfrkJojArd8HvWyyGqaDUnBQTYmrH+TE0pltwHdelg== Date: Sun, 12 May 2024 02:18:50 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20240512001850.GV6420@pb2> References: <20240512000349.3381912-1-michael@niedermayer.cc> <83bec738-e2dc-41a3-88af-a53ab6958628@lynne.ee> MIME-Version: 1.0 In-Reply-To: <83bec738-e2dc-41a3-88af-a53ab6958628@lynne.ee> X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH 1/5] avcodec/lpc: copy levenson coeffs only when they have been computed 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="===============5720184760671453694==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============5720184760671453694== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="PkzXzSPR9AApiveA" Content-Disposition: inline --PkzXzSPR9AApiveA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, May 12, 2024 at 02:13:06AM +0200, Lynne via ffmpeg-devel wrote: > On 12/05/2024 02:03, Michael Niedermayer wrote: > > Fixes: CID1473514 Uninitialized scalar variable > >=20 > > Sponsored-by: Sovereign Tech Fund > > Signed-off-by: Michael Niedermayer > > --- > > libavcodec/lpc.c | 5 +++-- > > 1 file changed, 3 insertions(+), 2 deletions(-) > >=20 > > diff --git a/libavcodec/lpc.c b/libavcodec/lpc.c > > index 8305cc0596a..981dacce8a5 100644 > > --- a/libavcodec/lpc.c > > +++ b/libavcodec/lpc.c > > @@ -282,8 +282,9 @@ int ff_lpc_calc_coefs(LPCContext *s, > > double av_uninit(weight); > > memset(var, 0, FFALIGN(MAX_LPC_ORDER+1,4)*sizeof(*var)); > > - for(j=3D0; j > - m[0].coeff[max_order-1][j] =3D -lpc[max_order-1][j]; > > + if (lpc_passes > 1) > > + for(j=3D0; j > + m[0].coeff[max_order-1][j] =3D -lpc[max_order-1][j]; > > for(; pass > avpriv_init_lls(&m[pass&1], max_order); >=20 > max_order is a function argument, I don't think that's the right place to > fix this. max_orders is fine what the problem is, is that CHOLESKY with lpc_passes =3D 1 skips the first pass LEVINSON but this line copies the output =66rom LEVINSON so it copies Uninitialized data. a few lines later thats cleared with avpriv_init_lls() but that access to uninitialized data i think is undefined behavior if my analysis is not wrong then i think my fix is correct 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 --PkzXzSPR9AApiveA Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZkAK6gAKCRBhHseHBAsP q9bIAJ9ilPdjryGNGa6aahxu7dm04KCmJgCePzuLVn+wp0DsnWQj5vfo7d9O59o= =De5j -----END PGP SIGNATURE----- --PkzXzSPR9AApiveA-- --===============5720184760671453694== 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". --===============5720184760671453694==--