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 97A8A4BCFE for ; Wed, 1 Oct 2025 11:12:39 +0000 (UTC) Authentication-Results: ffbox; dkim=fail (body hash mismatch (got b'YiT3Sdaa9OEsmEk4GnnwzMz+JQkF6IhPZdbpcnX5ICA=', expected b'XMboRkWBfCuhl52HIQItlMQ3W/95IgF9dLrCR6dPj1M=')) header.d=ffmpeg.org header.i=@ffmpeg.org header.a=rsa-sha256 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1759317143; h=mime-version : to : date : message-id : reply-to : subject : list-id : list-archive : list-archive : list-help : list-owner : list-post : list-subscribe : list-unsubscribe : from : cc : content-type : content-transfer-encoding : from; bh=YiT3Sdaa9OEsmEk4GnnwzMz+JQkF6IhPZdbpcnX5ICA=; b=vegagnD1sWr1z19wH1ceDohWx0f0j/HFajyPZTUmDzpYJwZ+TpQAIEwdEQQ1RPcom3eqB R06xZuy90mkb7Kygcj+9iTsaxmg1nU0i0S4qqL1p6nuhUXa8Soyg3BTFelzNKd6WHKv/+B2 vB7hCYeyDBbsZg8REqa9jMDPi78xRqq5LDwhYOB/T7vktoPCqcQMmRs4sMth+RFwTbdGkiL rbWUGrzsYUI8obpNRK3hLXGAnULTvDOJx8L9fNSd7Vs9Opze6mJDjlqmcbfDTz//+7Wm79/ mQQ7mVQW9w01TwYvGKnJa28w5PYfMriJeC1SHHOyme+hnWQqyhj86gzx56cA== Received: from [172.19.0.2] (unknown [172.19.0.2]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id D8C3B68EF6F; Wed, 1 Oct 2025 14:12:23 +0300 (EEST) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=ffmpeg.org; s=arc; t=1759317126; b=sEVak0E8Fn22Tu/mPrGwy3412IxtNEExAOX9PmWbB8AS/pCY6RIibgk7JM3jdbh04iCw6 UZAYJTt+pnjuQw4HRYzCTKo8PXs7IHFM7TV0QO1jz1YE9JHOha4npPBsGEQDdLd7W3EYtq9 +GXCK0UNVgeiIgBnQFfaTFJka1wE9rhImzbBEwwH8j2xq3NFzoaq1iNVfwr11/+PSlaJBPp 6enVsgBMQbZeATvcW7LA2GSG7P0Fa39I8QQ846nybbgyNGFo99VH2ivtIFpwgeAfzrVLqIj hs5QWqSXrFE7xHH4I1xmLKCkhbd6FOaVmKzKAC7W+HZej9AcJWk745JYrYog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=ffmpeg.org; s=arc; t=1759317126; h=from : sender : reply-to : subject : date : message-id : to : cc : mime-version : content-type : content-transfer-encoding : content-id : content-description : resent-date : resent-from : resent-sender : resent-to : resent-cc : resent-message-id : in-reply-to : references : list-id : list-help : list-unsubscribe : list-subscribe : list-post : list-owner : list-archive; bh=gyc3atQZXNz694rvCIUKjddMuE9jSfuujaKE9pqhG8A=; b=lQ4xobk1i+th9jfWZyIc43ZsQqKyB6lC90RIODbU/NNhcafERfLiKd+ohGlw6U1KLI7mf LvO+7K+wH2zL4QoJ1xsduZ7DQ3jWRYxt/cHTAZRx5yvNmvCoDYR6DcxnYfff1lVKEztoqst BsLg9YoxFHnLkRHmKrqVzuZH3uB3YxyvHxoZy8W8E0m00kSKO3CKt4EV47G6Ih71iud+L8r KzPRSGCBqp9cGjlSnQwwgpBhnU+zaiILVKBYekdpTMjzZWTHFB5r9gC9t2Gqx3umhlP7jxa gtyUdAReWVsilt1fxcErLNAvRujb/gTv+GcYkSrrMzwMXSK3N55Rl2aNI64A== ARC-Authentication-Results: i=1; ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none; dmarc=pass header.from=ffmpeg.org policy.dmarc=quarantine Authentication-Results: ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none (Message is not ARC signed); dmarc=pass (Used From Domain Record) header.from=ffmpeg.org policy.dmarc=quarantine DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1759317120; h=content-type : mime-version : content-transfer-encoding : from : to : reply-to : subject : date : from; bh=XMboRkWBfCuhl52HIQItlMQ3W/95IgF9dLrCR6dPj1M=; b=dJZzKD8Fnc8PWAZc3nGZ38QFajI8hUxVFYAs2yD97vTo/4A34jDwIhbtAtSYWGkmTu2RS /YyHXybVEUWWw7RE2u1vCAaazPbnz+eX5uxpMo0ydolA5XMDSb52R+S0nmyvZoZFEOXXLlv XQCHMWy9Dj3pDPuPOHQr8wbS0V+5USvpwifziIYv9th3Cq1aGEtwX9mCF1sJ2A0F9N7sl3H iqKyGJlbR54nm6lG8QyI1bJrzOmY2LvhQukldNdXIkglNj0sWo0pFe3iybRgnX5Gizs67ie ukwJ0dd3qnO8GBqtvFFuWcbCucNldzOSp9oI/i1KiwkTXPo+RHukTcZ3Ti2w== Received: from 13289e625de8 (code.ffmpeg.org [188.245.149.3]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 1ABB868EF67 for ; Wed, 1 Oct 2025 14:12:00 +0300 (EEST) MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Date: Wed, 01 Oct 2025 11:11:59 -0000 Message-ID: <175931712020.69.1278726322138558190@bf249f23a2c8> Message-ID-Hash: O7NRY4NRIBCXG6ZS7KNRAXCCH2QQ7M2Z X-Message-ID-Hash: O7NRY4NRIBCXG6ZS7KNRAXCCH2QQ7M2Z X-MailFrom: code@ffmpeg.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-ffmpeg-devel.ffmpeg.org-0; header-match-ffmpeg-devel.ffmpeg.org-1; header-match-ffmpeg-devel.ffmpeg.org-2; header-match-ffmpeg-devel.ffmpeg.org-3; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list Reply-To: FFmpeg development discussions and patches Subject: [FFmpeg-devel] [PATCH] Backport HTTP and RTSP fixes (PR #20635) List-Id: FFmpeg development discussions and patches Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Marvin Scholz via ffmpeg-devel Cc: Marvin Scholz Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Archived-At: List-Archive: List-Post: PR #20635 opened by Marvin Scholz (ePirat) URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20635 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20635.patch Backports #20541 and #20542 to 8.0 and I would also ideally like to backport those to 7.1 if there are no objections. >>From 09a6b6e981d5fea72182002ed94e93c24dee6b37 Mon Sep 17 00:00:00 2001 From: Marvin Scholz Date: Thu, 22 May 2025 20:14:49 +0200 Subject: [PATCH 1/3] avformat/http: Handle IPv6 Zone ID in hostname When using a literal IPv6 address as hostname, it can contain a Zone ID especially in the case of link-local addresses. Sending this to the server in the Host header is not useful to the server and in some cases servers refuse such requests. To prevent any such issues, strip the Zone ID from the address if it's an IPv6 address. This also removes it for the Cookies lookup. Based on a patch by: Daniel N Pettersson (cherry picked from commit 5cb6d2221a6d4c07453b6c301ecfcaed48402680) Signed-off-by: Marvin Scholz --- libavformat/http.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/libavformat/http.c b/libavformat/http.c index 0d4077512b..49d750b512 100644 --- a/libavformat/http.c +++ b/libavformat/http.c @@ -24,6 +24,7 @@ #include "config.h" #include "config_components.h" +#include #include #if CONFIG_ZLIB #include @@ -214,7 +215,7 @@ static int http_open_cnx_internal(URLContext *h, AVDictionary **options) const char *path, *proxy_path, *lower_proto = "tcp", *local_path; char *env_http_proxy, *env_no_proxy; char *hashmark; - char hostname[1024], hoststr[1024], proto[10]; + char hostname[1024], hoststr[1024], proto[10], tmp_host[1024]; char auth[1024], proxyauth[1024] = ""; char path1[MAX_URL_SIZE], sanitized_path[MAX_URL_SIZE + 1]; char buf[1024], urlbuf[MAX_URL_SIZE]; @@ -224,7 +225,14 @@ static int http_open_cnx_internal(URLContext *h, AVDictionary **options) av_url_split(proto, sizeof(proto), auth, sizeof(auth), hostname, sizeof(hostname), &port, path1, sizeof(path1), s->location); - ff_url_join(hoststr, sizeof(hoststr), NULL, NULL, hostname, port, NULL); + + av_strlcpy(tmp_host, hostname, sizeof(tmp_host)); + // In case of an IPv6 address, we need to strip the Zone ID, + // if any. We do it at the first % sign, as percent encoding + // can be used in the Zone ID itself. + if (strchr(tmp_host, ':')) + tmp_host[strcspn(tmp_host, "%")] = '\0'; + ff_url_join(hoststr, sizeof(hoststr), NULL, NULL, tmp_host, port, NULL); env_http_proxy = getenv_utf8("http_proxy"); proxy_path = s->http_proxy ? s->http_proxy : env_http_proxy; -- 2.49.1 >>From 624219121ea6cc21cfb2ca0b377b71642c14ff52 Mon Sep 17 00:00:00 2001 From: Marvin Scholz Date: Fri, 22 Aug 2025 16:50:34 +0200 Subject: [PATCH 2/3] avformat/rtsp: do not log invalid values When reading fails the first time, ch would be uninitialized and printed in the log message. Instead check for an error early and log it properly. (cherry picked from commit 2ed47ab72509bbee60288d245a0aebb7eb05e41a) Signed-off-by: Marvin Scholz --- libavformat/rtsp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index 10355b89b8..13507d1858 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -1239,9 +1239,12 @@ start: q = buf; for (;;) { ret = ffurl_read_complete(rt->rtsp_hd, &ch, 1); + if (ret != 1) { + ret = (ret < 0) ? ret : AVERROR(EIO); + av_log(s, AV_LOG_WARNING, "Failed reading RTSP data: %s\n", av_err2str(ret)); + return ret; + } av_log(s, AV_LOG_TRACE, "ret=%d c=%02x [%c]\n", ret, ch, ch); - if (ret != 1) - return ret < 0 ? ret : AVERROR(EIO); if (ch == '\n') break; if (ch == '$' && q == buf) { -- 2.49.1 >>From aab883b4959b4ffee7a9edc7cf742863ce63f422 Mon Sep 17 00:00:00 2001 From: Marvin Scholz Date: Fri, 22 Aug 2025 21:41:26 +0200 Subject: [PATCH 3/3] avformat/rtsp: fix leading space in RTSP reason When parsing the RTSP message reason, the whole remainder after parsing the status code was used, which would lead to a leading space in the parsed reason string. (cherry picked from commit e63e040f0cef2d6af2fb57aefa6250fc450fa049) Signed-off-by: Marvin Scholz --- libavformat/rtsp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index 13507d1858..d601d63a89 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -1274,6 +1274,7 @@ start: if (!strncmp(buf1, "RTSP/", 5)) { get_word(buf1, sizeof(buf1), &p); reply->status_code = atoi(buf1); + p += strspn(p, SPACE_CHARS); av_strlcpy(reply->reason, p, sizeof(reply->reason)); } else { av_strlcpy(reply->reason, buf1, sizeof(reply->reason)); // method -- 2.49.1 _______________________________________________ ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org