[SCM] libav/experimental: ff_url_join: Don't add any at-char if the auth is an empty string

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 17:08:48 UTC 2013


The following commit has been merged in the experimental branch:
commit a955fc5ee756b417eda0f1afbfaa69c4c6aafaa6
Author: Martin Storsjö <martin at martin.st>
Date:   Sat Jun 19 21:56:50 2010 +0000

    ff_url_join: Don't add any at-char if the auth is an empty string
    
    Originally committed as revision 23650 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavformat/internal.h b/libavformat/internal.h
index 358959c..4489ffe 100644
--- a/libavformat/internal.h
+++ b/libavformat/internal.h
@@ -131,7 +131,8 @@ void ff_url_split(char *proto, int proto_size,
  * @param size the size of the str buffer
  * @param proto the protocol identifier, if null, the separator
  *              after the identifier is left out, too
- * @param authorization an optional authorization string, may be null
+ * @param authorization an optional authorization string, may be null.
+ *                      An empty string is treated the same as a null string.
  * @param hostname the host name string
  * @param port the port number, left out from the string if negative
  * @param fmt a generic format string for everything to add after the
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 9faa566..59ca6bb 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -3601,7 +3601,7 @@ int ff_url_join(char *str, int size, const char *proto,
     str[0] = '\0';
     if (proto)
         av_strlcatf(str, size, "%s://", proto);
-    if (authorization)
+    if (authorization && authorization[0])
         av_strlcatf(str, size, "%s@", authorization);
 #if CONFIG_NETWORK && defined(AF_INET6)
     /* Determine if hostname is a numerical IPv6 address,

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list