summaryrefslogtreecommitdiff
path: root/libavformat/avio.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-05-18 00:53:21 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2016-05-18 00:53:21 +0200
commit936751b6527cff789ef077a4e43a04ae9e658232 (patch)
treed202ac05a67018122fc66fa6bb1cfabbe0f8169f /libavformat/avio.c
parent7bacf7453665b63ab9e2c496f82e49d9340679ba (diff)
avformat/avio: Fix null pointer dereference in case of memleak
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/avio.c')
-rw-r--r--libavformat/avio.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/avio.c b/libavformat/avio.c
index efde5f30e4..3606eb0fda 100644
--- a/libavformat/avio.c
+++ b/libavformat/avio.c
@@ -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)) {