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

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


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

XCB/window: fix potential use-after-free

(cherry picked from commit bd341a98366bab7b922390c278789c615b1b6f5c)

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

 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 07cd030..7e4e4e0 100644
--- a/modules/video_output/xcb/window.c
+++ b/modules/video_output/xcb/window.c
@@ -334,7 +334,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;
@@ -603,7 +606,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