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.
This commit is contained in:
Gabriel LT 2024-01-18 14:40:59 +01:00 committed by Steve Lhomme
parent d085a4396d
commit 5d643c7b14
1 changed files with 7 additions and 1 deletions

View File

@ -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);