mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 11:00:11 +01:00
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 <udknight@gmail.com> Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
This commit is contained in:
parent
9773369ab4
commit
7a6324dbfe
1 changed files with 6 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue