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 3CAA04DFD5 for ; Fri, 6 Jun 2025 03:09:44 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 22B0368C008; Fri, 6 Jun 2025 06:09:31 +0300 (EEST) Received: from mail.chinaffmpeg.org (unknown [101.33.120.246]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id E579D68BA68 for ; Fri, 6 Jun 2025 06:09:22 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=chinaffmpeg.org; s=mail; t=1749178930; bh=Y0WSmcdMoXP9kkaxoXUnIeLZ7EP3EOliiGNOq50FFrc=; h=From:To:Cc:Subject:In-Reply-To:References; b=Vbg7PWYHkyYiEvcxD9UXQXgMbeADaI6O2aLoLq8GbxZbBtgx/agB447wngHvBcsCm qthpTIUxf9SqKGCmQ9lAHgo1dLVZvt3BUf/9cIHvn3/Ldj6ESDPnp7kB3emp9Wnis2 n6W3nvB6SNi39+uyRDj5LHNiQ+WRWeFd2lYs3iOb6i43R7a7uhZ7zFlvVUGl6E4Kgw LStpx9We15xOQTRrxC8pXtnPci3pPdc2+MD1A0bC0xMRxqQ3lH1/G0tld3yYNTvjUZ g++dOTY5/knkmc2E/IpDaGBknL+RGlUDr7mCaRo5v6x3a04cGs0xse+R1IhnO03l1+ lU24A8vij14sQ== From: Steven Liu To: ffmpeg-devel@ffmpeg.org Date: Fri, 6 Jun 2025 11:02:06 +0800 Message-Id: <20250606030206.67340-2-lq@chinaffmpeg.org> In-Reply-To: <20250606030206.67340-1-lq@chinaffmpeg.org> References: <20250606030206.67340-1-lq@chinaffmpeg.org> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/2] avformat/whip: check the exchange sdp url is start with http 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 Cc: Steven Liu Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Make sure the WHIP protocol performs the SDP offer/answer exchange with the WebRTC peer over HTTP. Signed-off-by: Steven Liu --- libavformat/whip.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libavformat/whip.c b/libavformat/whip.c index ce06a66bc4..b78ad27858 100644 --- a/libavformat/whip.c +++ b/libavformat/whip.c @@ -732,10 +732,18 @@ static int exchange_sdp(AVFormatContext *s) URLContext *whip_uc = NULL; AVDictionary *opts = NULL; char *hex_data = NULL; + const char *proto_name = avio_find_protocol_name(s->url); /* To prevent a crash during cleanup, always initialize it. */ av_bprint_init(&bp, 1, MAX_SDP_SIZE); + if (!av_strstart(proto_name, "http", NULL)) { + av_log(whip, AV_LOG_ERROR, "WHIP: Protocol %s is not supported by RTC, choose http, url is %s\n", + proto_name, s->url); + ret = AVERROR(EINVAL); + goto end; + } + if (!whip->sdp_offer || !strlen(whip->sdp_offer)) { av_log(whip, AV_LOG_ERROR, "WHIP: No offer to exchange\n"); ret = AVERROR(EINVAL); -- 2.39.3 (Apple Git-146) _______________________________________________ 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".