[MPlayer-dev-eng] Idea for possible change

adland adland123 at yahoo.com
Sat Apr 3 07:37:21 CEST 2004


problem reported in user mailinglist recently as issue
url from a playlist with special characters (like " or space)
in parameters fails 

[quote]

Playing 
rtsp://media1.abc.net.au/rn/mod/atback_29032004_2856.rm?title="Australia 
Talks Back - 29/03/2004".
librtsp: buffer overflow in rtsp_get

possible fix which seems to work is to change libmpdemux/open.c
to escape the characters for stream url.

I used the existing function from libmpdemux/url.c

(Thinking also should limit to only certain protocols like rtsp)

comments appreciated .

thanks

diff -Naur main/libmpdemux/open.c updated/libmpdemux/open.c
--- main/libmpdemux/open.c      2003-09-03 15:26:33.000000000 -0400
+++ updated/libmpdemux/open.c   2004-04-02 23:03:46.000000000 -0500
@@ -113,6 +113,7 @@

 stream_t* open_stream(char* filename,char** options, int* file_format){
 stream_t* stream=NULL;
+char *escfilename;
 int f=-1;
 off_t len;
 *file_format = DEMUXER_TYPE_UNKNOWN;
@@ -480,7 +481,11 @@
     strncmp("vcd://", filename, 6) && strncmp("dvb://", filename, 6) &&
     strncmp("cdda://", filename, 7) && strncmp("cddb://", filename, 7) &&
     strstr(filename, "://"))
-    url = url_new(filename);
+       //fix filenames with special characters 
+        url_escape_string(escfilename,filename);
+     printf("Filename for url is now %s\n",escfilename);
+    url = url_new(escfilename);
   if(url) {
        if (strcmp(url->protocol, "smb")==0){
 #ifdef LIBSMBCLIENT





More information about the MPlayer-dev-eng mailing list