diff options
author | Nicolas George <nicolas.george@normalesup.org> | 2013-02-27 19:19:15 +0100 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2013-03-01 08:56:06 +0100 |
commit | 8ffe243c85e542a77f9bda8d6a79005ada7dff27 (patch) | |
tree | 70ef71f0dc9db9ff6fb72dba3be3f81faacb5d06 | |
parent | 62e55034077d60ed84e962a287069a60aecbaab6 (diff) | |
download | ffmpeg-8ffe243c85e542a77f9bda8d6a79005ada7dff27.tar.gz |
lavf/avio: check for : in filenames for protocols.
If the first "special" character in a filename is a comma,
it can introduce protocol options, but only if there is a
colon at the end. Otherwise, it is just a filename with a
comma.
Fix trac ticket #2303.
(cherry picked from commit d9fad53f4b447db1e436dcf3fc4a57e604616e6c)
-rw-r--r-- | libavformat/avio.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/avio.c b/libavformat/avio.c index abc70723ef..d7240f34de 100644 --- a/libavformat/avio.c +++ b/libavformat/avio.c @@ -209,7 +209,9 @@ int ffurl_alloc(URLContext **puc, const char *filename, int flags, "Missing call to av_register_all()?\n"); } - if (filename[proto_len] != ':' && filename[proto_len] != ',' || is_dos_path(filename)) + if (filename[proto_len] != ':' && + (filename[proto_len] != ',' || !strchr(filename + proto_len + 1, ':')) || + is_dos_path(filename)) strcpy(proto_str, "file"); else av_strlcpy(proto_str, filename, FFMIN(proto_len+1, sizeof(proto_str))); |