[vlc-devel] commit: Fix massive leak when --vout-filter or --vout module_Need fails ( Rémi Denis-Courmont )

git version control git at videolan.org
Fri Mar 6 21:42:18 CET 2009


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Mar  6 22:41:46 2009 +0200| [43cde503eb5dbdee466fd41ed5cbe197315b8953] | committer: Rémi Denis-Courmont 

Fix massive leak when --vout-filter or --vout module_Need fails

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=43cde503eb5dbdee466fd41ed5cbe197315b8953
---

 src/video_output/video_output.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 506a56e..f4143f5 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -487,6 +487,9 @@ vout_thread_t * __vout_Create( vlc_object_t *p_parent, video_format_t *p_fmt )
     if( p_vout->p_module == NULL )
     {
         msg_Err( p_vout, "no suitable vout module" );
+        spu_Attach( p_vout->p_spu, p_vout, false );
+        spu_Destroy( p_vout->p_spu );
+        p_vout->p_spu = NULL;
         vlc_object_release( p_vout );
         return NULL;
     }
@@ -583,7 +586,8 @@ static void vout_Destructor( vlc_object_t * p_this )
     assert( !p_vout->p_module );
 
     /* */
-    spu_Destroy( p_vout->p_spu );
+    if( p_vout->p_spu )
+        spu_Destroy( p_vout->p_spu );
 
     /* Destroy the locks */
     vlc_cond_destroy( &p_vout->p->change_wait );




More information about the vlc-devel mailing list