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 A6AAA4B528 for ; Sun, 7 Jul 2024 21:59:26 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A509468DB7A; Mon, 8 Jul 2024 00:59:24 +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 CE44E68D94E for ; Mon, 8 Jul 2024 00:59:18 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 32B761BF204 for ; Sun, 7 Jul 2024 21:59:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1720389558; 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=m/1ICqV+vRKdjgo99O5tDaq9H691380s89tm1d6OT50=; b=XMEb3kueb+Bk/itOLMrUexXul0yC7CBudwxf5WzEZ+t5T35bi58r0lOvNPE1gr3AqDpGfi JlLZ0RCt/KWAQ4OyuFAaT1MyCz3JJ8KW0xuD5sCSTEQ9MuKIpmL75HbufHJ5VxRxFThLba MOycjhFeEj5tX0hazsszVJGsTPa298GcXHiNBqOXbkZ8gTUS1YB3aVF+S0ZdndstulkDuT LLT74tCII8KLUZ82jnsh6SDjVu+xeTOXmJP71V6IO3Sy2FU9zs+1LJN00DVMM7UT8EOTmU EOStDkgmHGuz1P7zReYPR6yD9/Ox2EIDAmzRm01ucN+UBVzvFlg5GxkWhiGeqA== Date: Sun, 7 Jul 2024 23:59:17 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20240707215917.GT4991@pb2> References: <20240707184729.3525852-1-michael@niedermayer.cc> <20240707184729.3525852-6-michael@niedermayer.cc> MIME-Version: 1.0 In-Reply-To: X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH 6/6] avfilter/af_surround: Check av_channel_layout_channel_from_index() stays within the fixed array used 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="===============7094586560838580432==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============7094586560838580432== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ExUVf1g7Qw6kZX5X" Content-Disposition: inline --ExUVf1g7Qw6kZX5X Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jul 07, 2024 at 09:12:06PM +0200, Andreas Rheinhardt wrote: > Andreas Rheinhardt: > > Michael Niedermayer: > >> Fixes: CID1516994 Out-of-bounds access > >> Fixes: CID1516996 Out-of-bounds access > >> Fixes: CID1516999 Out-of-bounds access > >> > >> Sponsored-by: Sovereign Tech Fund > >> Signed-off-by: Michael Niedermayer > >> --- > >> libavfilter/af_surround.c | 3 +++ > >> 1 file changed, 3 insertions(+) > >> > >> diff --git a/libavfilter/af_surround.c b/libavfilter/af_surround.c > >> index e37dddc3614..fab39a37ea9 100644 > >> --- a/libavfilter/af_surround.c > >> +++ b/libavfilter/af_surround.c > >> @@ -269,6 +269,9 @@ static int config_output(AVFilterLink *outlink) > >> =20 > >> for (int ch =3D 0; ch < outlink->ch_layout.nb_channels; ch++) { > >> float iscale =3D 1.f; > >> + const int chan =3D av_channel_layout_channel_from_index(&s->o= ut_ch_layout, ch); > >> + if (chan >=3D FF_ARRAY_ELEMS(sc_map)) > >> + return AVERROR_PATCHWELCOME; > >> =20 > >> ret =3D av_tx_init(&s->irdft[ch], &s->itx_fn, AV_TX_FLOAT_RDF= T, > >> 1, s->win_size, &iscale, 0); > >=20 > > Can this happen? IMHO, this doesnt matter. A filter that depends on a audio channel layout API from another lib cannot depend on its implementation but just the public API/ABI So even if the av_channel_layout_* API didnt allow us to set such layout today we would need to check for it now can this happen? try this: =2E/ffmpeg -i matrixbench_mpeg2.mpg -af surround=3Dchl_out=3D"123456789" -f= null - I get a Segmentation fault (core dumped) and it doesnt segfault after the patch > >=20 >=20 > Apart from that: I think you are mistaken when you believe that this > will "fix" the issue. Coverity will not think that these issues are > fixed even with this check. After this patch the issue is either detected as fixed or not, if not then it becomes a false positive and either way is fixed thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Breaking DRM is a little like attempting to break through a door even though the window is wide open and the only thing in the house is a bunch of things you dont want and which you would get tomorrow for free anyway --ExUVf1g7Qw6kZX5X Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZosPsgAKCRBhHseHBAsP q0gUAJ9688RK44f7aWy8uBFPBAvCy9fwCgCfZecTQFbVAL3hat1w+GzgBm/zClo= =tYeb -----END PGP SIGNATURE----- --ExUVf1g7Qw6kZX5X-- --===============7094586560838580432== 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". --===============7094586560838580432==--