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 794D24964B for ; Wed, 14 Feb 2024 23:37:13 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E9A6768D213; Thu, 15 Feb 2024 01:37:10 +0200 (EET) Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 03C3468D08A for ; Thu, 15 Feb 2024 01:37:04 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id C19F4E9F51 for ; Thu, 15 Feb 2024 00:37:04 +0100 (CET) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id csV5kH4qdFEe for ; Thu, 15 Feb 2024 00:37:01 +0100 (CET) Received: from iq (iq [217.27.212.140]) by iq.passwd.hu (Postfix) with ESMTPS id 8CEDCE5958 for ; Thu, 15 Feb 2024 00:37:01 +0100 (CET) Date: Thu, 15 Feb 2024 00:37:01 +0100 (CET) From: Marton Balint To: FFmpeg development discussions and patches In-Reply-To: <20240212145319.7187-1-ingo@datarhei.com> Message-ID: <7fbf5767-68f8-25e8-a202-28917805e4b1@passwd.hu> References: <20240212145319.7187-1-ingo@datarhei.com> MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH] avformat/libsrt: Fix srt:// URL parsing 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Mon, 12 Feb 2024, Ingo Oppermann wrote: > Add missing NULL check and use ff_urldecode for string query > parameters. Will apply, thanks. Marton > > Signed-off-by: Ingo Oppermann > --- > libavformat/libsrt.c | 12 +++++++++--- > 1 file changed, 9 insertions(+), 3 deletions(-) > > diff --git a/libavformat/libsrt.c b/libavformat/libsrt.c > index cd8f5b1e7d..d549aea1f7 100644 > --- a/libavformat/libsrt.c > +++ b/libavformat/libsrt.c > @@ -32,6 +32,7 @@ > #include "network.h" > #include "os_support.h" > #include "url.h" > +#include "urldecode.h" > > /* This is for MPEG-TS and it's a default SRTO_PAYLOADSIZE for SRTT_LIVE (8 TS packets) */ > #ifndef SRT_LIVE_DEFAULT_PAYLOAD_SIZE > @@ -547,7 +548,11 @@ static int libsrt_open(URLContext *h, const char *uri, int flags) > } > if (av_find_info_tag(buf, sizeof(buf), "passphrase", p)) { > av_freep(&s->passphrase); > - s->passphrase = av_strndup(buf, strlen(buf)); > + s->passphrase = ff_urldecode(buf, 1); > + if (!s->passphrase) { > + ret = AVERROR(ENOMEM); > + goto err; > + } > } > #if SRT_VERSION_VALUE >= 0x010302 > if (av_find_info_tag(buf, sizeof(buf), "enforced_encryption", p)) { > @@ -632,7 +637,7 @@ static int libsrt_open(URLContext *h, const char *uri, int flags) > } > if (av_find_info_tag(buf, sizeof(buf), "streamid", p)) { > av_freep(&s->streamid); > - s->streamid = av_strdup(buf); > + s->streamid = ff_urldecode(buf, 1); > if (!s->streamid) { > ret = AVERROR(ENOMEM); > goto err; > @@ -640,7 +645,7 @@ static int libsrt_open(URLContext *h, const char *uri, int flags) > } > if (av_find_info_tag(buf, sizeof(buf), "smoother", p)) { > av_freep(&s->smoother); > - s->smoother = av_strdup(buf); > + s->smoother = ff_urldecode(buf, 1); > if(!s->smoother) { > ret = AVERROR(ENOMEM); > goto err; > @@ -671,6 +676,7 @@ static int libsrt_open(URLContext *h, const char *uri, int flags) > err: > av_freep(&s->smoother); > av_freep(&s->streamid); > + av_freep(&s->passphrase); > srt_cleanup(); > return ret; > } > -- > 2.39.3 (Apple Git-145) > > _______________________________________________ > 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". > _______________________________________________ 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".