Commit c12e1bd1 authored by Michael Niedermayer's avatar Michael Niedermayer

avio: allow any chars in protocols

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 2bb1c713
...@@ -265,17 +265,17 @@ int ffurl_alloc(URLContext **puc, const char *filename, int flags, ...@@ -265,17 +265,17 @@ int ffurl_alloc(URLContext **puc, const char *filename, int flags,
{ {
URLProtocol *up = NULL; URLProtocol *up = NULL;
char proto_str[128], proto_nested[128], *ptr; char proto_str[128], proto_nested[128], *ptr;
size_t proto_len = strspn(filename, URL_SCHEME_CHARS); const char *proto_end = strchr(filename, ':');
if (!first_protocol) { if (!first_protocol) {
av_log(NULL, AV_LOG_WARNING, "No URL Protocols are registered. " av_log(NULL, AV_LOG_WARNING, "No URL Protocols are registered. "
"Missing call to av_register_all()?\n"); "Missing call to av_register_all()?\n");
} }
if (filename[proto_len] != ':' || is_dos_path(filename)) if (!proto_end || is_dos_path(filename))
strcpy(proto_str, "file"); strcpy(proto_str, "file");
else else
av_strlcpy(proto_str, filename, FFMIN(proto_len+1, sizeof(proto_str))); av_strlcpy(proto_str, filename, FFMIN(proto_end-filename+1, sizeof(proto_str)));
av_strlcpy(proto_nested, proto_str, sizeof(proto_nested)); av_strlcpy(proto_nested, proto_str, sizeof(proto_nested));
if ((ptr = strchr(proto_nested, '+'))) if ((ptr = strchr(proto_nested, '+')))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment