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 F41D247C67 for ; Thu, 14 Dec 2023 19:18:17 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BA33568D220; Thu, 14 Dec 2023 21:18:14 +0200 (EET) Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B541568D068 for ; Thu, 14 Dec 2023 21:18:07 +0200 (EET) Received: by mail.gandi.net (Postfix) with ESMTPSA id D29A7240004 for ; Thu, 14 Dec 2023 19:18:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1702581487; 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=qxmNWCZNynIWuIddFP+C5fZgx/T6w7zYb8B98U6MZgo=; b=AVK20l2L24sCb7CJZcLlizSQfpVZd2Kpr9IpD4bczn0GP0ksF1Gtn0v3cXbCSRJaYMT/oI L6AVErvEegEB53s7ZLvpgksBD/+70ZOUxjKcebDmwWIIZA9CDtDPjt/jfD95FOfO+GI+s9 nEWjE+2ils27cgxIQWA4GENyPh8HYBBf/ddwop6rAupcVcRMaWObyciWFzjAsgP960NufS RRUbf0L3rwTyPuLmPKpR4S3C44eyV4yshNv5YMwKzAEuHvDab35axjhx3wGQJn8EFFpiEG F/u8hpaMEEChDwfK06R7qdZa8gjuSiaEIRyzewIs+6poETHBmVbsUwE1kPoIng== Date: Thu, 14 Dec 2023 20:18:06 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20231214191806.GL6420@pb2> References: <20231214030948.GH6420@pb2> <20231214143911.39198-1-ffmpeg@haasn.xyz> <20231214154036.GB39465@haasn.xyz> MIME-Version: 1.0 In-Reply-To: <20231214154036.GB39465@haasn.xyz> X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH] avfilter/formats: set audio fmt lists for vaf filters 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="===============2770228882960468317==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============2770228882960468317== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Mit9XoPEfICDqq/V" Content-Disposition: inline --Mit9XoPEfICDqq/V Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 14, 2023 at 03:40:36PM +0100, Niklas Haas wrote: > On Thu, 14 Dec 2023 15:39:11 +0100 Niklas Haas wrote: > > From: Niklas Haas > >=20 > > Currently, the logic inside the FF_FILTER_FORMATS_QUERY_FUNC branch > > prevents this code from running in the event that we have a filter with > > a single video input and a single audio output, as the resulting audio > > output link will not have its channel counts / samplerates correctly > > initialized to their default values, possibly triggering a segfault > > downstream. > >=20 > > An example of such a filter is vaf_spectrumsynth. Although this > > particular filter already sets up the channel counts and samplerates as > > part of the query function and therefore avoids triggering this bug, the > > bug still exists in principle. (And importantly, sets a wrong precedent) > > --- > > libavfilter/formats.c | 9 +++++---- > > 1 file changed, 5 insertions(+), 4 deletions(-) > >=20 > > diff --git a/libavfilter/formats.c b/libavfilter/formats.c > > index d1c97daf64..114886aeb2 100644 > > --- a/libavfilter/formats.c > > +++ b/libavfilter/formats.c > > @@ -808,16 +808,17 @@ int ff_default_query_formats(AVFilterContext *ctx) > > /* Intended fallthrough */ > > case FF_FILTER_FORMATS_PASSTHROUGH: > > case FF_FILTER_FORMATS_QUERY_FUNC: > > - type =3D ctx->nb_inputs ? ctx->inputs [0]->type : > > - ctx->nb_outputs ? ctx->outputs[0]->type : AVMEDIA_TY= PE_VIDEO; > > - formats =3D ff_all_formats(type); > > + type =3D AVMEDIA_TYPE_UNKNOWN; > > + formats =3D ff_all_formats(ctx->nb_inputs ? ctx->inputs [0]->= type : > > + ctx->nb_outputs ? ctx->outputs[0]->ty= pe : > > + AVMEDIA_TYPE_VIDEO); > > break; > > } > > =20 > > ret =3D ff_set_common_formats(ctx, formats); > > if (ret < 0) > > return ret; > > - if (type =3D=3D AVMEDIA_TYPE_AUDIO) { > > + if (type !=3D AVMEDIA_TYPE_VIDEO) { > > ret =3D ff_set_common_all_channel_counts(ctx); > > if (ret < 0) > > return ret; > > --=20 > > 2.43.0 > >=20 >=20 > This patch fixes the underlying issue (alongside the corresponding > adjustment to the conditional from `type =3D=3D AVMEDIA_TYPE_VIDEO` to `t= ype > !=3D AVMEDIA_TYPE_AUDIO` in patch 03/15). do you have some git branch i can test so i dont have to apply a patchset with adjustments and hope i have the exact same code ? thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB In fact, the RIAA has been known to suggest that students drop out of college or go to community college in order to be able to afford settlements. -- The RIAA --Mit9XoPEfICDqq/V Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZXtU7QAKCRBhHseHBAsP q3ESAJ0a0EOZlpjrUvLpORcMB21qZQK91QCePUMnUOtghW5DRnipdmWodHfgrs4= =T2Y/ -----END PGP SIGNATURE----- --Mit9XoPEfICDqq/V-- --===============2770228882960468317== 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". --===============2770228882960468317==--