Fixed a potential vout object leak in decoder.
authorLaurent Aimar <fenrir@videolan.org>
Sat, 29 Nov 2008 12:42:34 +0000 (13:42 +0100)
committerLaurent Aimar <fenrir@videolan.org>
Sun, 30 Nov 2008 15:51:44 +0000 (16:51 +0100)
src/input/decoder.c

index c61d07f..615a730 100644 (file)
@@ -2043,10 +2043,10 @@ static void DeleteDecoder( decoder_t * p_dec )
         vout_thread_t *p_vout;
 
         p_vout = vlc_object_find( p_dec, VLC_OBJECT_VOUT, FIND_ANYWHERE );
-        if( p_vout && p_owner->p_spu_vout == p_vout )
+        if( p_vout )
         {
-            spu_Control( p_vout->p_spu, SPU_CHANNEL_CLEAR,
-                         p_owner->i_spu_channel );
+            if( p_owner->p_spu_vout == p_vout )
+                spu_Control( p_vout->p_spu, SPU_CHANNEL_CLEAR, p_owner->i_spu_channel );
             vlc_object_release( p_vout );
         }
     }