From 5d643c7b14c6bfa02adbe119af8668c43d9a1acc Mon Sep 17 00:00:00 2001 From: Gabriel LT Date: Thu, 18 Jan 2024 14:40:59 +0100 Subject: [PATCH] core: fix crash in vlc_dialog_release Don't call get_dialog_provider in vlc_dialog_release to prevent a crash in case vlc_killed is true. --- src/interface/dialog.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/interface/dialog.c b/src/interface/dialog.c index 8e3048e895..c8c1efdd3c 100644 --- a/src/interface/dialog.c +++ b/src/interface/dialog.c @@ -732,7 +732,13 @@ void vlc_dialog_release(vlc_object_t *p_obj, vlc_dialog_id *p_id) { assert(p_obj != NULL && p_id != NULL); - vlc_dialog_provider *p_provider = get_dialog_provider(p_obj, false); + /* We can't use get_dialog_provider here because when vlc_killed is true, + * get_dialog_provider returns NULL, and we can't release the dialog + * properly. Moreover, since the dialog has been created by the provider, + * we can be sure that one exists. */ + vlc_dialog_provider *p_provider = + libvlc_priv(vlc_object_instance(p_obj))->p_dialog_provider; + assert(p_provider != NULL); vlc_mutex_lock(&p_provider->lock); dialog_cancel_locked(p_provider, p_id);