[vlc-commits] [Git][videolan/vlc][master] core: fix crash in vlc_dialog_release

Steve Lhomme (@robUx4) gitlab at videolan.org
Sun Jan 21 15:15:02 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
5d643c7b by Gabriel LT at 2024-01-21T14:56:30+00:00
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.

- - - - -


1 changed file:

- src/interface/dialog.c


Changes:

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



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/5d643c7b14c6bfa02adbe119af8668c43d9a1acc

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/5d643c7b14c6bfa02adbe119af8668c43d9a1acc
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list