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 DC4EA4951D for ; Mon, 13 May 2024 01:25:16 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 10EF468D4C7; Mon, 13 May 2024 04:25:14 +0300 (EEST) Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B1DB768D2C7 for ; Mon, 13 May 2024 04:25:07 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id E9ED540004 for ; Mon, 13 May 2024 01:25:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1715563507; 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=rH6oT+dAYnaJsJXt7rr8AQixzz6iTE38EtA4llxewfg=; b=XAYQO2tfthJpnCxpc05hFZv7WJzfoNjMLoU+XI7ezaMgIoaVN5FInu/AC2P5cbYwATt6zC nZy2/E36pUl3dNfHy46ObdveFqGAken4367+AVg6PTgguQyW7Mgg+3T5WLNzadgPAm9AHP NdQpanTeeNWX8QGhlpLgijUMhAPJ7e8vqN6Pw+qVvWLqmp+DAA8O1iCAQMOH8g6dxlbr7R 3hEAYiDBRWHiohFFirMGhy7ALlGcZp5xRERqQO9pxskzmot9R8DuD6pdHffQPsbDMAe3pX vfdfuj8jKiidXe5D5cEBbVvNYKV3VQmB+rw9TaBio+yUrju3elrsSXDVwuCiCg== Date: Mon, 13 May 2024 03:25:05 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20240513012505.GX6420@pb2> References: <20240512000349.3381912-1-michael@niedermayer.cc> <83bec738-e2dc-41a3-88af-a53ab6958628@lynne.ee> <20240512001850.GV6420@pb2> MIME-Version: 1.0 In-Reply-To: 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="===============5582980687485752771==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============5582980687485752771== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="KMw8oWSPp4xLtbah" Content-Disposition: inline --KMw8oWSPp4xLtbah Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, May 12, 2024 at 02:29:57AM +0200, Lynne via ffmpeg-devel wrote: > On 12/05/2024 02:18, Michael Niedermayer wrote: > > 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 plac= e to > > > fix this. > >=20 > > max_orders is fine > >=20 > > what the problem is, is that CHOLESKY with lpc_passes =3D 1 > > skips the first pass LEVINSON but this line copies the output > > from 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 > >=20 > > if my analysis is not wrong then i think my fix is correct > >=20 > > thx > >=20 > > [...] > >=20 > >=20 > > _______________________________________________ > > ffmpeg-devel mailing list > > ffmpeg-devel@ffmpeg.org > > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > >=20 > > To unsubscribe, visit link above, or email > > ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". >=20 > Ah, I see. Could you put a small comment above, like: > /* Avoids initializing with an unused value when max_order =3D=3D 1 */? > Other than that looks fine. ok, will apply with such note thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB There will always be a question for which you do not know the correct answe= r. --KMw8oWSPp4xLtbah Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZkFr6AAKCRBhHseHBAsP q9P0AJ9KfosQIKQmSB14YodJ/d2C3r4yLwCeP6EA32PuWp8HEYllA5V7ZXUoYIY= =JvHC -----END PGP SIGNATURE----- --KMw8oWSPp4xLtbah-- --===============5582980687485752771== 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". --===============5582980687485752771==--