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 9A1DA42F14 for ; Sat, 13 May 2023 14:54:32 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D1CE668BFA0; Sat, 13 May 2023 17:54:29 +0300 (EEST) Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BA6F668BF06 for ; Sat, 13 May 2023 17:54:23 +0300 (EEST) Received: (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id C551560006 for ; Sat, 13 May 2023 14:54:22 +0000 (UTC) Date: Sat, 13 May 2023 16:54:22 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20230513145422.GG1391451@pb2> References: <20230512202622.29531-1-leo.izen@gmail.com> MIME-Version: 1.0 In-Reply-To: <20230512202622.29531-1-leo.izen@gmail.com> Subject: Re: [FFmpeg-devel] [PATCH] avformat/hls: look for trailing GET headers with m3u8 extension check 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="===============6901238189739214043==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============6901238189739214043== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Nwn6wlxaqfRJxJFc" Content-Disposition: inline --Nwn6wlxaqfRJxJFc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 12, 2023 at 04:26:22PM -0400, Leo Izen wrote: > After commit 6b1f68ccb04d791f0250e05687c346a99ff47ea1 we refuse to use > URLs of the form https://foo.bar/baz.m3u8?foo=3Dbar because it fails the > file extension check. This commit strips the ?foo=3Dbar at the end before > checking the file extension. >=20 > Signed-off-by: Leo Izen > --- > libavformat/hls.c | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) >=20 > diff --git a/libavformat/hls.c b/libavformat/hls.c > index 11e345b280..6a97cced17 100644 > --- a/libavformat/hls.c > +++ b/libavformat/hls.c > @@ -2534,7 +2534,16 @@ static int hls_probe(const AVProbeData *p) > strstr(p->buf, "#EXT-X-TARGETDURATION:") || > strstr(p->buf, "#EXT-X-MEDIA-SEQUENCE:")) { > =20 > - if (!av_match_ext(p->filename, "m3u8,hls,m3u")) { > + char *request_qmark =3D strchr(p->filename, '?'); > + int match_ext; > + > + if (request_qmark) > + *request_qmark =3D '\0'; > + match_ext =3D av_match_ext(p->filename, "m3u8,hls,m3u"); > + if (request_qmark) > + *request_qmark =3D '?'; > + > + if (!match_ext) { > av_log(NULL, AV_LOG_ERROR, "Not detecting m3u8/hls with non = standard extension\n"); > return 0; > } the av_match_ext here matches the probe code all should be fixed. Also differences between local files and urls should be considered in extension extraction thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The misfortune of the wise is better than the prosperity of the fool. -- Epicurus --Nwn6wlxaqfRJxJFc Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZF+kmAAKCRBhHseHBAsP qwNvAKCTsb5b2Ev5VOz8QWgoM29zBy8p8gCbBTgWUBwIEXBAZSIDuizrx0Rn530= =qnd1 -----END PGP SIGNATURE----- --Nwn6wlxaqfRJxJFc-- --===============6901238189739214043== 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". --===============6901238189739214043==--