aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/avio.c
diff options
context:
space:
mode:
authorNicolas George <nicolas.george@normalesup.org>2013-02-27 19:19:15 +0100
committerNicolas George <nicolas.george@normalesup.org>2013-02-28 19:30:56 +0100
commitd9fad53f4b447db1e436dcf3fc4a57e604616e6c (patch)
treee860b2191b72f703f1f665b3d7b9c990ca4e8bbe /libavformat/avio.c
parent3d2adeb6f8b71c62bce034300f9220b01b92f88d (diff)
downloadffmpeg-d9fad53f4b447db1e436dcf3fc4a57e604616e6c.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.
Diffstat (limited to 'libavformat/avio.c')
-rw-r--r--libavformat/avio.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/avio.c b/libavformat/avio.c
index b00cc9d349..f6af0cb9e6 100644
--- a/libavformat/avio.c
+++ b/libavformat/avio.c
@@ -220,7 +220,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)));