From 70a5d33c9e41c077a8cd92abd43376e2956d3aed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Tue, 16 Oct 2007 12:46:07 +0200 Subject: [PATCH] Always check the return value of __glXGetDrawable first. Fixes spurious GLX protocol errors because __glXGetDrawable doesn't set the error code in case of success. Maybe it should, though. --- GL/glx/glxcmds.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GL/glx/glxcmds.c b/GL/glx/glxcmds.c index 7fd1f4dee..f6e032193 100644 --- a/GL/glx/glxcmds.c +++ b/GL/glx/glxcmds.c @@ -1617,7 +1617,7 @@ int __glXDisp_ReleaseTexImageEXT(__GLXclientState *cl, GLbyte *pc) return error; pGlxDraw = __glXGetDrawable(NULL, drawId, client, &error); - if (error != Success || pGlxDraw->type != GLX_DRAWABLE_PIXMAP) { + if (!pGlxDraw || pGlxDraw->type != GLX_DRAWABLE_PIXMAP) { client->errorValue = drawId; return error; } @@ -1675,7 +1675,7 @@ int __glXDisp_CopySubBufferMESA(__GLXclientState *cl, GLbyte *pc) } pGlxDraw = __glXGetDrawable(glxc, drawId, client, &error); - if (error != Success) + if (!pGlxDraw) return error; if (pGlxDraw == NULL ||