From bcfa8de45dfd41d733965840991d446f64f0d6e2 Mon Sep 17 00:00:00 2001 From: Pierre d'Herbemont Date: Fri, 29 Jan 2010 11:46:54 +0100 Subject: [PATCH] lua/extension: Make sure our input exists when releasing/holding. --- modules/misc/lua/extension.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/misc/lua/extension.c b/modules/misc/lua/extension.c index 8ef54b906b..3e5d571e55 100644 --- a/modules/misc/lua/extension.c +++ b/modules/misc/lua/extension.c @@ -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; -- 2.39.2