avformat/avio: Fix null pointer dereference in case of memleak
authorMichael Niedermayer <michael@niedermayer.cc>
Tue, 17 May 2016 22:53:21 +0000 (00:53 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Tue, 17 May 2016 22:53:21 +0000 (00:53 +0200)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/avio.c

index efde5f3..3606eb0 100644 (file)
@@ -270,6 +270,8 @@ static const struct URLProtocol *url_find_protocol(const char *filename)
         *ptr = '\0';
 
     protocols = ffurl_get_protocols(NULL, NULL);
+    if (!protocols)
+        return NULL;
     for (i = 0; protocols[i]; i++) {
             const URLProtocol *up = protocols[i];
         if (!strcmp(proto_str, up->name)) {