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 09:01:56 +0100 |
commit | cbadebd8ccd05e2f7786869d524c289af914eb14 (patch) | |
tree | fbec2a16adb41fcfb1bd22ddd441e929a31b1195 | |
parent | 9f0bf48b5ce4476f889f52344fc8ab6bb904f874 (diff) | |
download | ffmpeg-cbadebd8ccd05e2f7786869d524c289af914eb14.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 67005e3eca..16700d838c 100644 --- a/libavformat/avio.c +++ b/libavformat/avio.c @@ -296,7 +296,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))); |