]> git.sesse.net Git - vlc/blobdiff - projects/mozilla/vlcplugin.cpp
Merge branch 1.0-bugfix
[vlc] / projects / mozilla / vlcplugin.cpp
index 0d137cd225fe38d2558454074c96c3a07d90dbb3..552d6fdad43fb9a780a511f1e6f5e19b90094110 100644 (file)
@@ -50,7 +50,6 @@ VlcPlugin::VlcPlugin( NPP instance, uint16 mode ) :
     libvlc_instance(NULL),
     libvlc_media_list(NULL),
     libvlc_media_player(NULL),
-    libvlc_log(NULL),
     p_scriptClass(NULL),
     p_browser(instance),
     psz_baseURL(NULL)
@@ -267,8 +266,6 @@ VlcPlugin::~VlcPlugin()
 {
     free(psz_baseURL);
     free(psz_target);
-    if( libvlc_log )
-        libvlc_log_close(libvlc_log, NULL);
     if( libvlc_media_player )
         libvlc_media_player_release( libvlc_media_player );
     if( libvlc_media_list )
@@ -476,7 +473,7 @@ relativeurl:
             if( href )
             {
                 /* prepend base URL */
-                strcpy(href, psz_baseURL);
+                memcpy(href, psz_baseURL, baseLen+1);
 
                 /*
                 ** relative url could be empty,
@@ -491,7 +488,7 @@ relativeurl:
 
                 /* skip over protocol part  */
                 char *pathstart = strchr(href, ':');
-                char *pathend;
+                char *pathend = href+baseLen;
                 if( pathstart )
                 {
                     if( '/' == *(++pathstart) )
@@ -503,7 +500,6 @@ relativeurl:
                     }
                     /* skip over host part */
                     pathstart = strchr(pathstart, '/');
-                    pathend = href+baseLen;
                     if( ! pathstart )
                     {
                         // no path, add a / past end of url (over '\0')
@@ -521,7 +517,6 @@ relativeurl:
                         return NULL;
                     }
                     pathstart = href;
-                    pathend = href+baseLen;
                 }
 
                 /* relative URL made of an absolute path ? */