[vlc-commits] XCB/window: fix potential use-after-free

Rémi Denis-Courmont git at videolan.org
Sun Mar 16 10:54:38 CET 2014


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Mar 16 11:54:23 2014 +0200| [bd341a98366bab7b922390c278789c615b1b6f5c] | committer: Rémi Denis-Courmont

XCB/window: fix potential use-after-free

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=bd341a98366bab7b922390c278789c615b1b6f5c
---

 modules/video_output/xcb/window.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/modules/video_output/xcb/window.c b/modules/video_output/xcb/window.c
index 5717dab..246429d 100644
--- a/modules/video_output/xcb/window.c
+++ b/modules/video_output/xcb/window.c
@@ -328,7 +328,10 @@ static int Open (vout_window_t *wnd, const vout_window_cfg_t *cfg)
      * request from this thread must be completed at this point. */
     if ((p_sys->keys != NULL)
      && vlc_clone (&p_sys->thread, Thread, wnd, VLC_THREAD_PRIORITY_LOW))
+    {
         XCB_keyHandler_Destroy (p_sys->keys);
+        p_sys->keys = NULL;
+    }
 
     xcb_flush (conn); /* Make sure map_window is sent (should be useless) */
     return VLC_SUCCESS;
@@ -595,7 +598,10 @@ static int EmOpen (vout_window_t *wnd, const vout_window_cfg_t *cfg)
     CacheAtoms (p_sys);
     if ((p_sys->keys != NULL)
      && vlc_clone (&p_sys->thread, Thread, wnd, VLC_THREAD_PRIORITY_LOW))
+    {
         XCB_keyHandler_Destroy (p_sys->keys);
+        p_sys->keys = NULL;
+    }
 
     xcb_flush (conn);
     (void) cfg;



More information about the vlc-commits mailing list