]> git.sesse.net Git - vlc/blobdiff - modules/video_filter/blendbench.c
Forgotten mem leak.
[vlc] / modules / video_filter / blendbench.c
index dab13aba8b43f5ab676ade201b75400f2c622b7d..0c93a9f23114d4e318f48de089702ea7db543d8c 100644 (file)
@@ -29,7 +29,7 @@
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_sout.h>
 #include <vlc_vout.h>
@@ -152,7 +152,7 @@ static int Create( vlc_object_t *p_this )
 {
     filter_t *p_filter = (filter_t *)p_this;
     filter_sys_t *p_sys;
-    char *psz_temp;
+    char *psz_temp, *psz_cmd;
 
     /* Allocate structure */
     p_filter->p_sys = malloc( sizeof( filter_sys_t ) );
@@ -177,17 +177,21 @@ static int Create( vlc_object_t *p_this )
     psz_temp = var_CreateGetStringCommand( p_filter, CFG_PREFIX "base-chroma" );
     p_sys->i_base_chroma = VLC_FOURCC( psz_temp[0], psz_temp[1],
                                        psz_temp[2], psz_temp[3] );
+    psz_cmd = var_CreateGetStringCommand( p_filter, CFG_PREFIX "base-image" );
     blendbench_LoadImage( p_this, &p_sys->p_base_image, p_sys->i_base_chroma,
-               var_CreateGetStringCommand( p_filter, CFG_PREFIX "base-image" ),
-               "Base" );
+                          psz_cmd, "Base" );
+    free( psz_temp );
+    free( psz_cmd );
 
     psz_temp = var_CreateGetStringCommand( p_filter,
                                            CFG_PREFIX "blend-chroma" );
     p_sys->i_blend_chroma = VLC_FOURCC( psz_temp[0], psz_temp[1],
                                         psz_temp[2], psz_temp[3] );
+    psz_cmd = var_CreateGetStringCommand( p_filter, CFG_PREFIX "blend-image" );
     blendbench_LoadImage( p_this, &p_sys->p_blend_image, p_sys->i_blend_chroma,
-               var_CreateGetStringCommand( p_filter, CFG_PREFIX "blend-image" ),
-               "Blend" );
+                          psz_cmd, "Blend" );
+    free( psz_temp );
+    free( psz_cmd );
 
     return VLC_SUCCESS;
 }
@@ -200,8 +204,8 @@ static void Destroy( vlc_object_t *p_this )
     filter_t *p_filter = (filter_t *)p_this;
     filter_sys_t *p_sys = p_filter->p_sys;
 
-    p_sys->p_base_image->pf_release( p_sys->p_base_image );
-    p_sys->p_blend_image->pf_release( p_sys->p_blend_image );
+    picture_Release( p_sys->p_base_image );
+    picture_Release( p_sys->p_blend_image );
 }
 
 /*****************************************************************************
@@ -215,10 +219,10 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
     if( p_sys->b_done )
         return p_pic;
 
-    p_blend = vlc_object_create( p_filter, VLC_OBJECT_FILTER );
+    p_blend = vlc_object_create( p_filter, sizeof(filter_t) );
     if( !p_blend )
     {
-        p_pic->pf_release( p_pic );
+        picture_Release( p_pic );
         return NULL;
     }
     vlc_object_attach( p_blend, p_filter );
@@ -227,7 +231,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
     p_blend->p_module = module_Need( p_blend, "video blending", 0, 0 );
     if( !p_blend->p_module )
     {
-        p_pic->pf_release( p_pic );
+        picture_Release( p_pic );
         vlc_object_detach( p_blend );
         vlc_object_release( p_blend );
         return NULL;