summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <ceffmpeg@gmail.com>2019-03-28 19:33:22 +0100
committerCarl Eugen Hoyos <ceffmpeg@gmail.com>2019-04-19 13:56:19 +0200
commitdd06f022b07438d650c82255dff16908ba04244a (patch)
tree44945d6f68554478ea4137a27d18409a9ef9726e
parent3bef1dab6e881bf593037f831e66ed87c6167e3c (diff)
lavf/utils: Allow url credentials to contain a slash.
Fixes ticket #7816.
-rw-r--r--libavformat/utils.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 9b3f0d28e6..c3ec4cc7fd 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)