aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-11-10 17:02:02 +0100
committerMichael Niedermayer <michaelni@gmx.at>2011-11-22 18:57:01 +0100
commitc12e1bd1bc7f0dd0dae2937d7f8c564e887c84ff (patch)
tree46a774c1b63f424a406de54286c9c6caa0e8950a
parent2bb1c713cc7e8fd018a3a0b579145a31a1c47bce (diff)
downloadffmpeg-c12e1bd1bc7f0dd0dae2937d7f8c564e887c84ff.tar.gz
avio: allow any chars in protocols
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/avio.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavformat/avio.c b/libavformat/avio.c
index b2b39b32d7..446f681f6c 100644
--- a/libavformat/avio.c
+++ b/libavformat/avio.c
@@ -265,17 +265,17 @@ int ffurl_alloc(URLContext **puc, const char *filename, int flags,
{
URLProtocol *up = NULL;
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) {
av_log(NULL, AV_LOG_WARNING, "No URL Protocols are registered. "
"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");
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));
if ((ptr = strchr(proto_nested, '+')))