[FFmpeg-cvslog] lavf/avio: check for : in filenames for protocols.

Nicolas George git at videolan.org
Fri Mar 1 09:02:26 CET 2013


ffmpeg | branch: release/1.0 | Nicolas George <nicolas.george at normalesup.org> | Wed Feb 27 19:19:15 2013 +0100| [8ffe243c85e542a77f9bda8d6a79005ada7dff27] | committer: Carl Eugen Hoyos

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)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8ffe243c85e542a77f9bda8d6a79005ada7dff27
---

 libavformat/avio.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/avio.c b/libavformat/avio.c
index abc7072..d7240f3 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)));



More information about the ffmpeg-cvslog mailing list