]> git.sesse.net Git - vlc/blobdiff - modules/video_filter/osdmenu.c
Fix memleak.
[vlc] / modules / video_filter / osdmenu.c
index 105089eb757ae5005841562c610fc937cac466dd..8a492046d74685a09d2da76824d0b3f7f421c81d 100644 (file)
@@ -228,18 +228,11 @@ static int CreateFilter ( vlc_object_t *p_this )
         p_sys->p_menu->i_x = 0;
         p_sys->p_menu->i_y = 0;
     }
-    else if( (p_sys->i_x >= 0) || (p_sys->i_y >= 0) )
+    else
     {
         p_sys->p_menu->i_x = p_sys->i_x;
         p_sys->p_menu->i_y = p_sys->i_y;
     }
-    else if( (p_sys->p_menu->i_x < 0) ||
-             (p_sys->p_menu->i_y < 0) )
-    {
-        p_sys->b_absolute = false;
-        p_sys->p_menu->i_x = 0;
-        p_sys->p_menu->i_y = 0;
-    }
 
     /* Set up p_filter */
     p_sys->i_last_date = mdate();
@@ -279,6 +272,7 @@ error:
 
     osd_MenuDelete( p_this, p_sys->p_menu );
     p_sys->p_menu = NULL;
+    free( p_sys->psz_path );
     free( p_sys->psz_file );
     free( p_sys );
     return VLC_EGENERIC;
@@ -331,6 +325,7 @@ static void DestroyFilter( vlc_object_t *p_this )
     {
         osd_MenuDelete( p_filter, p_sys->p_menu );
 
+        free( p_sys->psz_path );
         free( p_sys->psz_file );
         free( p_sys );
     }
@@ -469,8 +464,9 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t i_date )
         return NULL; /* we are too early, so wait */
 
     /* Allocate the subpicture internal data. */
-    p_spu = p_filter->pf_sub_buffer_new( p_filter );
-    if( !p_spu ) return NULL;
+    p_spu = filter_NewSubpicture( p_filter );
+    if( !p_spu )
+        return NULL;
 
     p_spu->b_ephemer = true;
     p_spu->b_fade = true;