summaryrefslogtreecommitdiffstats
path: root/src/glx
diff options
context:
space:
mode:
authorWang YanQing <[email protected]>2012-03-20 11:49:42 +0800
committerYuanhan Liu <[email protected]>2012-03-28 09:51:16 +0800
commit7a6324dbfe8d354b9b5f3181af0ce6bebbb374cc (patch)
treed4076df9fb5a361910e423baa98bd0e7627f8915 /src/glx
parent9773369ab4d1c75965821635f448733edde98636 (diff)
glx:dri_common.c: check psc->driScreen->createDrawable return value
createDrawable may return NULL value, we should check it, or it will make a segment failed. [minor-indent-issue-fixed-by: Yuanhan Liu] Signed-off-by: Wang YanQing <[email protected]> Reviewed-by: Yuanhan Liu <[email protected]>
Diffstat (limited to 'src/glx')
-rw-r--r--src/glx/dri_common.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/glx/dri_common.c b/src/glx/dri_common.c
index 0e06d51b4c7..07fd0154e1b 100644
--- a/src/glx/dri_common.c
+++ b/src/glx/dri_common.c
@@ -403,6 +403,12 @@ driFetchDrawable(struct glx_context *gc, GLXDrawable glxDrawable)
pdraw = psc->driScreen->createDrawable(psc, glxDrawable,
glxDrawable, gc->config);
+
+ if (pdraw == NULL) {
+ ErrorMessageF("failed to create drawable\n");
+ return NULL;
+ }
+
if (__glxHashInsert(priv->drawHash, glxDrawable, pdraw)) {
(*pdraw->destroyDrawable) (pdraw);
return NULL;