[Mesa-dev] [PATCH] glx: Extra gc null check for glXMakeCurrent

Juha-Pekka Heikkila juhapekka.heikkila at gmail.com
Mon Nov 25 07:23:29 PST 2013


Extra null check before accessing user given context pointer.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
---
 src/glx/glxcurrent.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/glx/glxcurrent.c b/src/glx/glxcurrent.c
index a6884cf..b9f259e 100644
--- a/src/glx/glxcurrent.c
+++ b/src/glx/glxcurrent.c
@@ -234,7 +234,7 @@ MakeContextCurrent(Display * dpy, GLXDrawable draw,
    _glapi_check_multithread();
 
    __glXLock();
-   if (oldGC == gc &&
+   if (oldGC == gc && gc != NULL &&
        gc->currentDrawable == draw && gc->currentReadable == read) {
       __glXUnlock();
       return True;
-- 
1.8.1.2



More information about the mesa-dev mailing list