1 From a59c7428549c8be0724bcfceecd596582840852b Mon Sep 17 00:00:00 2001
2 From: Chris Wilson <chris@chris-wilson.co.uk>
3 Date: Thu, 24 Jun 2010 12:24:58 +0100
4 Subject: [PATCH] glx: Prevent NULL context deref in __glXGetDrawable()
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 During a SwapBuffers request, we may end up querying an unknown drawable
10 outside of an active context, and so need to report this error prior to
11 attempting to dereference the NULL context.
15 [Bug 29184] glXSwapBuffers with no GLX context crashes X.
16 https://bugs.freedesktop.org/show_bug.cgi?id=29184
18 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
19 Cc: Kristian Høgsberg <krh@bitplanet.net>
21 glx/glxcmds.c | 7 +++++++
22 1 files changed, 7 insertions(+), 0 deletions(-)
24 diff --git a/glx/glxcmds.c b/glx/glxcmds.c
25 index 9e5b213..8d13c15 100644
28 @@ -491,6 +491,13 @@ __glXGetDrawable(__GLXcontext *glxc, GLXDrawable drawId, ClientPtr client,
32 + /* No active context and an unknown drawable, bail. */
34 + client->errorValue = drawId;
39 /* The drawId wasn't a GLX drawable. Make sure it's a window and
40 * create a GLXWindow for it. Check that the drawable screen
41 * matches the context screen and that the context fbconfig is