summaryrefslogtreecommitdiff
path: root/src/egl/drivers
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2013-02-05 13:43:01 +0000
committerJosé Fonseca <jfonseca@vmware.com>2013-02-06 09:22:26 +0000
commit5048e693926c2016b3e54af39557a675e267ad38 (patch)
treec5a76aeb605053c7e14abcdcc0cdfafa137f1679 /src/egl/drivers
parentd08cee5d80f394d8391c09f8506b2ee97125dcc1 (diff)
egl/dri: Don't invoke dri2_dpy->flush if it's NULL.
I'd like to test Mesa OpenGL ES along side with NVIDIA libGL drivers. But without this change, I get a NULL pointer dereference. Reviewed-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'src/egl/drivers')
-rw-r--r--src/egl/drivers/dri2/egl_dri2.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 0ffbc68649c..ae842d7a1bb 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -976,7 +976,8 @@ dri2_wait_client(_EGLDriver *drv, _EGLDisplay *disp, _EGLContext *ctx)
/* FIXME: If EGL allows frontbuffer rendering for window surfaces,
* we need to copy fake to real here.*/
- (*dri2_dpy->flush->flush)(dri2_surf->dri_drawable);
+ if (dri2_dpy->flush != NULL)
+ dri2_dpy->flush->flush(dri2_surf->dri_drawable);
return EGL_TRUE;
}