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 <udknight@gmail.com>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
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;