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

Ian Romanick idr at freedesktop.org
Mon Nov 25 09:12:57 PST 2013


On 11/25/2013 07:23 AM, Juha-Pekka Heikkila wrote:
> Extra null check before accessing user given context pointer.

oldGC can never be NULL.  If there is no current context, it will point
to dummyContext.

> 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;
> 



More information about the mesa-dev mailing list