]> git.sesse.net Git - vlc/commitdiff
lua/extension: Make sure our input exists when releasing/holding.
authorPierre d'Herbemont <pdherbemont@free.fr>
Fri, 29 Jan 2010 10:46:54 +0000 (11:46 +0100)
committerPierre d'Herbemont <pdherbemont@free.fr>
Fri, 29 Jan 2010 10:49:25 +0000 (11:49 +0100)
modules/misc/lua/extension.c

index 8ef54b906b4a525db46487a0291ba149a08d985d..3e5d571e5544408335a3afd31448fb39a5ab8b6c 100644 (file)
@@ -472,8 +472,10 @@ static int Control( extensions_manager_t *p_mgr, int i_control, va_list args )
             bool ok = LockExtension(p_ext);
             if (!ok)
                 return VLC_EGENERIC;
-            vlc_object_release(p_ext->p_sys->p_input);
-            p_ext->p_sys->p_input = vlc_object_hold(p_input);
+            input_thread_t *old = p_ext->p_sys->p_input;
+            if (old)
+                vlc_object_release(old);
+            p_ext->p_sys->p_input = p_input ? vlc_object_hold(p_input) : p_input;
             UnlockExtension(p_ext);
 
             return VLC_SUCCESS;