diff mbox

[FFmpeg-devel] lavf/utils: Allow url credentials to contain a slash

Message ID CAB0OVGq5PAB7oNYCtwr7J5=MKUB-EbBPHUonTLsEqucFtS17mA@mail.gmail.com
State Accepted
Headers show

Commit Message

Carl Eugen Hoyos March 28, 2019, 6:35 p.m. UTC
Hi!

Attached patch fixes ticket #7816 for me.

Please review, Carl Eugen

Comments

Carl Eugen Hoyos April 2, 2019, 11:19 p.m. UTC | #1
2019-03-28 19:35 GMT+01:00, Carl Eugen Hoyos <ceffmpeg@gmail.com>:

> Attached patch fixes ticket #7816 for me.
>
> Please review, Carl Eugen

Ping.

Carl Eugen
Carl Eugen Hoyos April 7, 2019, 11:06 p.m. UTC | #2
2019-04-03 1:19 GMT+02:00, Carl Eugen Hoyos <ceffmpeg@gmail.com>:
> 2019-03-28 19:35 GMT+01:00, Carl Eugen Hoyos <ceffmpeg@gmail.com>:
>
>> Attached patch fixes ticket #7816 for me.
>>
>> Please review, Carl Eugen
>
> Ping.

Please comment.

Carl Eugen
Carl Eugen Hoyos April 18, 2019, 12:17 p.m. UTC | #3
2019-03-28 19:35 GMT+01:00, Carl Eugen Hoyos <ceffmpeg@gmail.com>:

> Attached patch fixes ticket #7816 for me.

I will push this patch if there are no comments.

Carl Eugen
Carl Eugen Hoyos April 19, 2019, 11:58 a.m. UTC | #4
2019-03-28 19:35 GMT+01:00, Carl Eugen Hoyos <ceffmpeg@gmail.com>:

> Attached patch fixes ticket #7816 for me.

Patch applied.

Carl Eugen
diff mbox

Patch

From 7f5536c76fc873c18b49c1181f34f7585c48dc87 Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Date: Thu, 28 Mar 2019 19:33:22 +0100
Subject: [PATCH] lavf/utils: Allow url credentials to contain a slash.

Fixes ticket #7816.
---
 libavformat/utils.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 9b3f0d2..c3ec4cc 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -4730,7 +4730,7 @@  void av_url_split(char *proto, int proto_size,
                   char *hostname, int hostname_size,
                   int *port_ptr, char *path, int path_size, const char *url)
 {
-    const char *p, *ls, *ls2, *at, *at2, *col, *brk;
+    const char *p, *ls, *ls2, *ls3, *at, *at2, *col, *brk;
 
     if (port_ptr)
         *port_ptr = -1;
@@ -4760,6 +4760,9 @@  void av_url_split(char *proto, int proto_size,
     /* separate path from hostname */
     ls = strchr(p, '/');
     ls2 = strchr(p, '?');
+    ls3 = strchr(p, '@');
+    if (ls3 && ls3 > ls && (!ls2 || ls2 > ls3))
+        ls = strchr(ls3, '/');
     if (!ls)
         ls = ls2;
     else if (ls && ls2)
-- 
1.7.10.4