diff options
Diffstat (limited to 'xorg-server/glx/glxcmds.c')
-rw-r--r-- | xorg-server/glx/glxcmds.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/xorg-server/glx/glxcmds.c b/xorg-server/glx/glxcmds.c index d5b764fd0..b88d6f663 100644 --- a/xorg-server/glx/glxcmds.c +++ b/xorg-server/glx/glxcmds.c @@ -30,6 +30,10 @@ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> +#else + +#include "glheader.h" + #endif #include <string.h> @@ -213,6 +217,12 @@ static __GLXcontext *__glXdirectContextCreate(__GLXscreen *screen, return context; } +void FlushContext(__GLXcontext *cx) +{ + CALL_Flush( GET_DISPATCH(), () ); + cx->hasUnflushedCommands = GL_FALSE; +} + /** * Create a GL context with the given properties. This routine is used * to implement \c glXCreateContext, \c glXCreateNewContext, and @@ -476,7 +486,7 @@ __glXGetDrawable(__GLXcontext *glxc, GLXDrawable drawId, ClientPtr client, return NULL; } - if (pDraw->pScreen != glxc->pGlxScreen->pScreen) { + if (!glxc || pDraw->pScreen != glxc->pGlxScreen->pScreen) { client->errorValue = pDraw->pScreen->myNum; *error = BadMatch; return NULL; @@ -489,6 +499,12 @@ __glXGetDrawable(__GLXcontext *glxc, GLXDrawable drawId, ClientPtr client, pDraw, drawId, GLX_DRAWABLE_WINDOW, drawId, glxc->config); + if (!pGlxDraw) + { + client->errorValue = drawId; + *error = BadMatch; + return NULL; + } /* since we are creating the drawablePrivate, drawId should be new */ if (!AddResource(drawId, __glXDrawableRes, pGlxDraw)) { |