lavf/libssh: read empty path from url as /
authorMariusz SzczepaƄczyk <mszczepanczyk@gmail.com>
Tue, 23 Jun 2015 01:04:20 +0000 (03:04 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 23 Jun 2015 22:43:17 +0000 (00:43 +0200)
Reviewed-by: Lukasz Marek <lukasz.m.luki2 at gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/libssh.c

index 256e4da..ee42924 100644 (file)
@@ -204,6 +204,9 @@ static av_cold int libssh_connect(URLContext *h, const char *url, char *path, si
                  path, path_size,
                  url);
 
+    if (!(*path))
+        av_strlcpy(path, "/", path_size);
+
     // a port of 0 will use a port from ~/.ssh/config or the default value 22
     if (port < 0 || port > 65535)
         port = 0;