[vlc-commits] [Git][videolan/vlc][master] vout: fix deadlock on ICC profile update

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Mon Aug 15 09:49:38 UTC 2022



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
575bef69 by Niklas Haas at 2022-08-15T09:21:46+00:00
vout: fix deadlock on ICC profile update

This was taking more locks than necessary, causing a possible deadlock,
because window events are not supposed to lock the window lock.

The display lock is more than sufficient to guard access to this field.

Fixes: 354f3aae4dacfbfff93bebcd05aa89294cd48896

- - - - -


1 changed file:

- src/video_output/video_output.c


Changes:

=====================================
src/video_output/video_output.c
=====================================
@@ -681,13 +681,9 @@ void vout_ChangeIccProfile(vout_thread_t *vout,
     vout_thread_sys_t *sys = VOUT_THREAD_TO_SYS(vout);
     assert(!sys->dummy);
 
-    vlc_mutex_lock(&sys->window_lock);
+    vlc_queuedmutex_lock(&sys->display_lock);
     free(sys->display_cfg.icc_profile);
     sys->display_cfg.icc_profile = profile;
-
-    vlc_queuedmutex_lock(&sys->display_lock);
-    vlc_mutex_unlock(&sys->window_lock);
-
     if (sys->display != NULL)
         vout_SetDisplayIccProfile(sys->display, profile);
     vlc_queuedmutex_unlock(&sys->display_lock);



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/575bef6915ed06d34ede68eae945e6d93aebf03c

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/575bef6915ed06d34ede68eae945e6d93aebf03c
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