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 279604C14B for ; Thu, 4 Sep 2025 00:02:32 +0000 (UTC) Authentication-Results: ffbox; dkim=fail (body hash mismatch (got b'D8C/xBUwVid08tv8oSgYjRdK2f7H5khrvwHAV4cwef0=', expected b'eCgHzhYlVJakCndHSlT6h3l3nS9dQL9g5400FA2VADk=')) 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=1756944115; h=mime-version : to : 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=D8C/xBUwVid08tv8oSgYjRdK2f7H5khrvwHAV4cwef0=; b=undzszHbKJ5atDoC/cAJ4zkpQ2QGOKCECqiEysqP9zOybmTFVdbMxMB4QhYQ6mQWGsWLh y8tvkMrdsCDhGuodqSE23MoWsivVrB2n/lSQNf7+QH6LJlYtGuk+xrp7d0x6dvN6EKgSued 6Tk5O0eSTMiGjp2jV4/zBh++tKsj0Z6s9JeL7cSLOHMqQlrgc8wF6znSRhpp+l5Bef0w0Gt RB87IWF1v81cEQ8b/WP6UuMjCqkOtO6p/HyyCeNWkq1WHdsjeTv3Kgitw8rL/T7AEP45UwJ s/sP85JX2NIFjeQfA4d9UmyxPY5doMA2KpeiQbF1GbUps4Zf+B5crh6ZK5MA== Received: from [172.19.0.4] (unknown [172.19.0.4]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id DBE5968E7BB; Thu, 4 Sep 2025 03:01:55 +0300 (EEST) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=ffmpeg.org; s=arc; t=1756944097; b=FyleJYWAF45dxn/5Xo9JtpfcqEXCNdSChRoOO/GPiV4BONHvrEnrloyO4+gZ7wXJdjl/y OSVC5EHAf2vjVdPfquLjs3PKBmygCQRPNt/EdrNFBMhecwrx5QEF4ac9cViOwqEMvxvtP2g Hdt1RA8jpHsCWppaa7eRJjiSb38qqnxJimaarcJs2gO5R+HPW0pTpM9hXnaJK1rTQzmpBs4 axJ/o1ei3hgJZQrF4SiPQ8R2KUTmpv5O4nrbzVNVU+gk8sO4TWHa6Gc2t5jbxzczwvgjuT6 ECiolkuCilhzQPIf+ai0LgVSUCeM2UltvPRrh4TDTGlp3cJXhsRm5P/eyaug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=ffmpeg.org; s=arc; t=1756944097; 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=VVAUB/TmfKRh7diW7GT/086LLqJxM4JpQbL7zP2fdmM=; b=qEIjOoxmtQbwMHAiIZbHBUqyFC7r0n3PBfmiMOoTsmqNaxn4xp/Yf4t1W0uU4A2sxgdQR Kk1cE5g1XCoD+3vISgb6g305fRXEp3kpMYTyOZO8V4oxpQhNAmQXUVFYFmNjA7oVkDKwVS2 rxb8BGH393Z+59VPi2APApCnr0smY2VGmsLby1zTs/qN2NU5AybviZmBJbWNa5WFhsjoyO1 SsTnA5Jasrad7MIPThxr4RrvXLhR8LnSp+t0QDB1rBEbEFJ9pn4FxQR6ehLPjVFOAYyR6Jh 71pEfEFjf9HAsHN8aKfDgiG5FZ0JQvRUELIx4mF6WqjYt7cdcUgRJuaQYSFg== ARC-Authentication-Results: i=1; ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none; dmarc=none Authentication-Results: ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none (Message is not ARC signed); dmarc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1756944087; h=content-type : mime-version : content-transfer-encoding : from : to : reply-to : subject : from; bh=eCgHzhYlVJakCndHSlT6h3l3nS9dQL9g5400FA2VADk=; b=BzdOKJgwqFfquGQf3kN+Z45hS++0VF1wl7dbRix0jgFCQqKDO6xu+YbPLtP0XDT9untac 8lbxTbo9f++jq+mwFJ7wACTfcYNgPwJSvwZtvhlpB+r22IzgJFL6jXFTzzGD8o0f9Yo1uA4 w1k0PSnvJ37Wc3JFT0DVlFWCJP5sE6HrPXFg+aLnZqMxmWVfF4C8srcsUYT04p/2lDVjNU4 GFzc/OTreoPre6dp8z2paTiQOI/65Z0SHv8YJrY5xXElAZYAK+VThsLjWgy+KPpvLSa5wb2 S+Me8lHeD/MRQQkFGi0IVhzAhLRakaAULuegRvQFCA7+IsuvSYIv6gp0013w== Received: from 5d8f51c41678 (code.ffmpeg.org [188.245.149.3]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 592BB68E72E for ; Thu, 4 Sep 2025 03:01:27 +0300 (EEST) MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Message-ID: <175694408755.25.8830817372459910390@463a07221176> Message-ID-Hash: WNQFEDJBYJPCWRQXAXTWZGKGXMUT6RVD X-Message-ID-Hash: WNQFEDJBYJPCWRQXAXTWZGKGXMUT6RVD 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] avformat/whip: fix SDP ICE candidates parsing (PR #20423) 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: Jack Lau via ffmpeg-devel Cc: Jack Lau Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Archived-At: List-Archive: List-Post: PR #20423 opened by Jack Lau (JackLau) URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20423 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20423.patch fix issue #20407 Refer to RFC 5245 15.1, the foundation may be any string up to 32 chars. The old code could misread foundations as transport("udp"). This patch fully parse all these attr to avoid parsing error. Signed-off-by: Jack Lau >>From e1e7c6cca557a6d17b39a281efe077caf0455f07 Mon Sep 17 00:00:00 2001 From: Jack Lau Date: Thu, 4 Sep 2025 07:49:41 +0800 Subject: [PATCH] avformat/whip: fix SDP ICE candidates parsing fix issue #20407 Refer to RFC 5245 15.1, the foundation may be any string up to 32 chars. The old code could misread foundations as transport("udp"). This patch fully parse all these attr to avoid parsing error. Signed-off-by: Jack Lau --- libavformat/whip.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libavformat/whip.c b/libavformat/whip.c index 1fcf19aaa3..6a7b2bbc14 100644 --- a/libavformat/whip.c +++ b/libavformat/whip.c @@ -848,12 +848,12 @@ static int parse_answer(AVFormatContext *s) goto end; } } else if (av_strstart(line, "a=candidate:", &ptr) && !whip->ice_protocol) { - ptr = av_stristr(ptr, "udp"); if (ptr && av_stristr(ptr, "host")) { - char protocol[17], host[129]; - int priority, port; - ret = sscanf(ptr, "%16s %d %128s %d typ host", protocol, &priority, host, &port); - if (ret != 4) { + /* Refer to RFC 5245 15.1 */ + char foundation[33], protocol[17], host[129]; + int component_id, priority, port; + ret = sscanf(ptr, "%32s %d %16s %d %128s %d typ host", foundation, &component_id, protocol, &priority, host, &port); + if (ret != 6) { av_log(whip, AV_LOG_ERROR, "Failed %d to parse line %d %s from %s\n", ret, i, line, whip->sdp_answer); ret = AVERROR(EIO); -- 2.49.1 _______________________________________________ ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org