changeset 21493:8ca0be3a46a0

Make sure invalid protocols are rejected instead of treated just like file://
author reimar
date Tue, 05 Dec 2006 18:30:48 +0000
parents 1351ac8b333f
children b383701ad879
files stream/stream.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/stream/stream.c	Tue Dec 05 10:51:28 2006 +0000
+++ b/stream/stream.c	Tue Dec 05 18:30:48 2006 +0000
@@ -213,7 +213,8 @@
     for(j = 0 ; sinfo->protocols[j] ; j++) {
       l = strlen(sinfo->protocols[j]);
       // l == 0 => Don't do protocol matching (ie network and filenames)
-      if((l == 0) || ((strncmp(sinfo->protocols[j],filename,l) == 0) &&
+      if((l == 0 && !strstr(filename, "://")) ||
+         ((strncmp(sinfo->protocols[j],filename,l) == 0) &&
 		      (strncmp("://",filename+l,3) == 0))) {
 	*file_format = DEMUXER_TYPE_UNKNOWN;
 	s = open_stream_plugin(sinfo,filename,mode,options,file_format,&r);