From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 2BFC94D182 for ; Fri, 30 May 2025 22:08:23 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 7C09D68DB66; Sat, 31 May 2025 01:08:18 +0300 (EEST) Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 1357668DAA0 for ; Sat, 31 May 2025 01:08:11 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 3076A41C7D for ; Fri, 30 May 2025 22:08:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1748642891; 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=9iayqxB3UGo4UCJDcIGViM+0oiDhXzRWUUR/IOGfk74=; b=h7FXiNWakXdszRudYm/uWSUa0MXTG4VgVaqcI/2WHIyXX8/MHk97HV7N9OTNj7vtodXQKi qik4q9tN+OXr204OikuTQfRG0l8nyEAC507lkWIEblAfTYAkpHTwU2RiMnihZiZC4Qb87x hw2rrYxaGmtI3l0PKZ/2E8RImuVK169ukngD/lKMCGtJHJnFm8Uw+JqHX4VUeZlJsy764k 7tB+5EBKaz4KgxFk/0s8FeurC+ay79gub/ovDa4jlP4Mv7uJBKAAE59Vj2ll6NbXvC5Pz2 cZ+/O8t0zBfXkQRChiyPifa/zEqYGrImMksMJj51z/5Jv5qNCv9WjBV0d1FtWg== Date: Sat, 31 May 2025 00:08:10 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20250530220810.GP29660@pb2> References: <20250517035029.202-1-kasper93@gmail.com> <20250530194739.GL29660@pb2> MIME-Version: 1.0 In-Reply-To: X-GND-State: clean X-GND-Score: -85 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddtgdeftddujeculddtuddrgeefvddrtddtmdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrhhlucfvnfffucdludehmdenucfjughrpeffhffvuffkfhggtggujgesghdtreertddtjeenucfhrhhomhepofhitghhrggvlhcupfhivgguvghrmhgrhigvrhcuoehmihgthhgrvghlsehnihgvuggvrhhmrgihvghrrdgttgeqnecuggftrfgrthhtvghrnhepleekgefgffeiudefjeeuffejudehtddtudeltdehveevvedtieeulefhtdeutdeknecukfhppeeguddrieeirdeijedruddufeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeeguddrieeirdeijedruddufedphhgvlhhopehlohgtrghlhhhoshhtpdhmrghilhhfrhhomhepmhhitghhrggvlhesnhhivgguvghrmhgrhigvrhdrtggtpdhnsggprhgtphhtthhopedupdhrtghpthhtohepfhhfmhhpvghgqdguvghvvghlsehffhhmphgvghdrohhrgh X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH 1/2] avformat/demux: use io_close2 when closing avfromat 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="===============2460186684562969294==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============2460186684562969294== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="UPLGDX9N/0fgzaln" Content-Disposition: inline --UPLGDX9N/0fgzaln Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 30, 2025 at 10:48:29PM +0200, Andreas Rheinhardt wrote: > Michael Niedermayer: > > On Sat, May 17, 2025 at 03:03:19PM +0200, Andreas Rheinhardt wrote: > >> Andreas Rheinhardt: > >>> Kacper Michaj=C5=82ow: > >>>> It's not valid to call avio_close() on context that has not been open > >>>> with avio_open(). > >>>> > >>>> This fixes use of custom IO. (io_open / io_close2 callbacks) > >>>> > >>>> Note that by default io_close2 is set to io_close2_default() which c= alls > >>>> avio_close(), so default case will work the same as before. > >>>> > >>>> Signed-off-by: Kacper Michaj=C5=82ow > >>>> --- > >>>> libavformat/demux.c | 3 +-- > >>>> 1 file changed, 1 insertion(+), 2 deletions(-) > >>>> > >>>> diff --git a/libavformat/demux.c b/libavformat/demux.c > >>>> index 2795863567..ecd4f40da9 100644 > >>>> --- a/libavformat/demux.c > >>>> +++ b/libavformat/demux.c > >>>> @@ -383,11 +383,10 @@ void avformat_close_input(AVFormatContext **ps) > >>>> if (ffifmt(s->iformat)->read_close) > >>>> ffifmt(s->iformat)->read_close(s); > >>>> =20 > >>>> + ff_format_io_close(s, &pb); > >>>> avformat_free_context(s); > >>>> =20 > >>>> *ps =3D NULL; > >>>> - > >>>> - avio_close(pb); > >>>> } > >>>> =20 > >>>> static void force_codec_ids(AVFormatContext *s, AVStream *st) > >>> > >>> avformat_open_input() sets AVFMT_FLAG_CUSTOM_IO when using custom IO = and > >>> avformat_close_input() checks for this and does not free the > >>> AVFormatContext's AVIOContext in this case (but does avio_close(NULL)= in > >>> this case). > >>> Your patch furthermore presumes that the custom IO context is compati= ble > >>> with io_close2, which need not be true at all (one can use custom IO > >>> without ever touching io_open/io_close2 pointers; I expect users that > >>> use custom IO, but not formats that open new AVIOContexts to do so). > >> > >> On reading a bit further, init_input() uses io_open to open the > >> AVIOContext in case no AVIOContext was supplied (and one is needed). > >> This means that the AVFMT_FLAG_CUSTOM_IO flag is misleading, as it is > >> possible to use custom IO even with this flag unset. > >=20 > >> It also means that > >> your patch is likely correct. > >=20 > > does any reason remain against applying it ? > >=20 >=20 > I don't see any. ok, will apply it then thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB What is kyc? Its a tool that makes you give out your real ID, while crimina= ls give out a forged ID card. --UPLGDX9N/0fgzaln Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCaDosRgAKCRBhHseHBAsP q3W1AJ92edwb1+fOOBB6l9qHyPjYigolggCeLzy7Q5p/vgVPRe2vUVKzWm9t0wc= =pYTN -----END PGP SIGNATURE----- --UPLGDX9N/0fgzaln-- --===============2460186684562969294== 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". --===============2460186684562969294==--