aboutsummaryrefslogtreecommitdiff
path: root/xorg-server
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-02-23 12:37:25 +0100
committermarha <marha@users.sourceforge.net>2012-02-23 12:37:25 +0100
commit1b73fdf9c9aa2330380300d204fb47f512cfb6e2 (patch)
tree9e3cfdefdbcb948c28695741b991bd5698e96480 /xorg-server
parentc28585804e57d3da878c640be1369eed784ce52b (diff)
downloadvcxsrv-1b73fdf9c9aa2330380300d204fb47f512cfb6e2.tar.gz
vcxsrv-1b73fdf9c9aa2330380300d204fb47f512cfb6e2.tar.bz2
vcxsrv-1b73fdf9c9aa2330380300d204fb47f512cfb6e2.zip
Solved possible crashes when drawable cannot be created.
Diffstat (limited to 'xorg-server')
-rw-r--r--xorg-server/glx/glxcmds.c6
-rw-r--r--xorg-server/glx/glxdriswrast.c7
2 files changed, 13 insertions, 0 deletions
diff --git a/xorg-server/glx/glxcmds.c b/xorg-server/glx/glxcmds.c
index ee3f94dfb..b88d6f663 100644
--- a/xorg-server/glx/glxcmds.c
+++ b/xorg-server/glx/glxcmds.c
@@ -499,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)) {
diff --git a/xorg-server/glx/glxdriswrast.c b/xorg-server/glx/glxdriswrast.c
index 26936c3dd..434653e70 100644
--- a/xorg-server/glx/glxdriswrast.c
+++ b/xorg-server/glx/glxdriswrast.c
@@ -334,6 +334,13 @@ __glXDRIscreenCreateDrawable(ClientPtr client,
(*driScreen->swrast->createNewDrawable)(driScreen->driScreen,
config->driConfig,
private);
+ if (!private->driDrawable)
+ {
+ FreeGC(private->gc, (GContext)0);
+ FreeGC(private->swapgc, (GContext)0);
+ free(private);
+ return NULL;
+ }
return &private->base;
}