On 02/05/2013 06:43 AM, jfons...@vmware.com wrote:
From: José Fonseca<jfons...@vmware.com>

I'd like to test Mesa OpenGL ES along side with NVIDIA libGL drivers. But
without this change, I get a NULL pointer dereference.
---
  src/egl/drivers/dri2/egl_dri2.c |    3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 351fbf4..01e6302 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -970,7 +970,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);

I'd simplify that line to read:

         dri2_dpy->flush->flush(dri2_surf->dri_drawable);



     return EGL_TRUE;
  }

Reviewed-by: Brian Paul <bri...@vmware.com>
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to