dri2: protect dri2FlushFrontBuffer against NULL buffers.
authorStéphane Marchesin <marcheu@chromium.org>
Sat, 4 Jun 2011 00:03:09 +0000 (17:03 -0700)
committerStéphane Marchesin <marcheu@chromium.org>
Mon, 6 Jun 2011 19:35:59 +0000 (12:35 -0700)
src/glx/dri2_glx.c

index 69b47ae45e2d5716ce74be976d7f3d71363601c6..506754ccc1fad021cb62d2fe22eb919261561eca 100644 (file)
@@ -457,6 +457,12 @@ static void
 dri2FlushFrontBuffer(__DRIdrawable *driDrawable, void *loaderPrivate)
 {
    struct dri2_drawable *pdraw = loaderPrivate;
+   if (!pdraw)
+      return;
+
+   if (!pdraw->base.psc)
+      return;
+
    struct glx_display *priv = __glXInitialize(pdraw->base.psc->dpy);
    struct dri2_display *pdp = (struct dri2_display *)priv->dri2Display;
    struct glx_context *gc = __glXGetCurrentContext();