]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/avio.c
Merge commit '01f0e6a0c9270f1d5bef08459a6f167cf55e0596'
[ffmpeg] / libavformat / avio.c
index 0be820b9ec53c3a208e6d2b4f9d2d713a91c5bf8..6bfa67f3ba22a6093ef76c18d8cb74063344a54f 100644 (file)
@@ -249,7 +249,6 @@ int ffurl_handshake(URLContext *c)
 
 static const struct URLProtocol *url_find_protocol(const char *filename)
 {
-    const URLProtocol *up;
     const URLProtocol **protocols;
     char proto_str[128], proto_nested[128], *ptr;
     size_t proto_len = strspn(filename, URL_SCHEME_CHARS);
@@ -271,16 +270,19 @@ static const struct URLProtocol *url_find_protocol(const char *filename)
 
     protocols = ffurl_get_protocols(NULL, NULL);
     for (i = 0; protocols[i]; i++) {
-        up = protocols[i];
-        if (!strcmp(proto_str, up->name))
-            break;
+            const URLProtocol *up = protocols[i];
+        if (!strcmp(proto_str, up->name)) {
+            av_freep(&protocols);
+            return up;
+        }
         if (up->flags & URL_PROTOCOL_FLAG_NESTED_SCHEME &&
-            !strcmp(proto_nested, up->name))
-            break;
+            !strcmp(proto_nested, up->name)) {
+            av_freep(&protocols);
+            return up;
+        }
     }
-    av_freep(&protocols);
 
-    return up;
+    return NULL;
 }
 
 int ffurl_alloc(URLContext **puc, const char *filename, int flags,
@@ -295,7 +297,7 @@ int ffurl_alloc(URLContext **puc, const char *filename, int flags,
     *puc = NULL;
     if (av_strstart(filename, "https:", NULL))
         av_log(NULL, AV_LOG_WARNING, "https protocol not found, recompile FFmpeg with "
-                                     "openssl, gnutls,\n"
+                                     "openssl, gnutls "
                                      "or securetransport enabled.\n");
     return AVERROR_PROTOCOL_NOT_FOUND;
 }