diff --git a/libavformat/avio.c b/libavformat/avio.c
index 2bdad73..fd13ace 100644
--- a/libavformat/avio.c
+++ b/libavformat/avio.c
@@ -223,6 +223,11 @@ int ffurl_alloc(URLContext **puc, const char *filename, int flags)
     char proto_str[128], proto_nested[128], *ptr;
     size_t proto_len = strspn(filename, URL_SCHEME_CHARS);
 
+    if (first_protocol == NULL) {
+        *puc = NULL;
+        return AVERROR_NO_URL_PROTO_REG;
+    }
+
     if (filename[proto_len] != ':' || is_dos_path(filename))
         strcpy(proto_str, "file");
     else
diff --git a/libavutil/error.c b/libavutil/error.c
index d296395..10ae458 100644
--- a/libavutil/error.c
+++ b/libavutil/error.c
@@ -39,6 +39,9 @@ int av_strerror(int errnum, char *errbuf, size_t errbuf_size)
     case AVERROR_PATCHWELCOME:      errstr = "Not yet implemented in FFmpeg, patches welcome"; break;
     case AVERROR_PROTOCOL_NOT_FOUND:errstr = "Protocol not found"                           ; break;
     case AVERROR_STREAM_NOT_FOUND:  errstr = "Stream not found"                             ; break;
+    case AVERROR_NO_URL_PROTO_REG:  errstr = "No URL Protocols are registered. "
+                                             "Missing call to av_register_all()?"           ; break;
+
     }
 
     if (errstr) {
diff --git a/libavutil/error.h b/libavutil/error.h
index 47d366e..bf253fa 100644
--- a/libavutil/error.h
+++ b/libavutil/error.h
@@ -50,6 +50,7 @@
 #define AVERROR_PATCHWELCOME       (-MKTAG( 'P','A','W','E')) ///< Not yet implemented in FFmpeg, patches welcome
 #define AVERROR_PROTOCOL_NOT_FOUND (-MKTAG(0xF8,'P','R','O')) ///< Protocol not found
 #define AVERROR_STREAM_NOT_FOUND   (-MKTAG(0xF8,'S','T','R')) ///< Stream not found
+#define AVERROR_NO_URL_PROTO_REG   (-MKTAG(0xF8,'N','U','P')) ///< No URL Protocols are registered.
 
 /**
  * Put a description of the AVERROR code errnum in errbuf.
