diff options
author | Wang YanQing <[email protected]> | 2012-03-20 11:49:42 +0800 |
---|---|---|
committer | Yuanhan Liu <[email protected]> | 2012-03-28 09:51:16 +0800 |
commit | 7a6324dbfe8d354b9b5f3181af0ce6bebbb374cc (patch) | |
tree | d4076df9fb5a361910e423baa98bd0e7627f8915 /src | |
parent | 9773369ab4d1c75965821635f448733edde98636 (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')
-rw-r--r-- | src/glx/dri_common.c | 6 |
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; |