dri/nouveau: fix crash in nouveau_flush
authorJan de Groot <jan@jgc.homeip.net>
Thu, 7 Mar 2013 18:48:13 +0000 (19:48 +0100)
committerMarcin Slusarz <marcin.slusarz@gmail.com>
Thu, 7 Mar 2013 18:55:07 +0000 (19:55 +0100)
https://bugs.freedesktop.org/show_bug.cgi?id=61947

Note: this is a candidate for the stable branches

src/mesa/drivers/dri/nouveau/nouveau_driver.c

index f56b3b2..6c119d5 100644 (file)
@@ -69,7 +69,8 @@ nouveau_flush(struct gl_context *ctx)
                __DRIdri2LoaderExtension *dri2 = screen->dri2.loader;
                __DRIdrawable *drawable = nctx->dri_context->driDrawablePriv;
 
-               dri2->flushFrontBuffer(drawable, drawable->loaderPrivate);
+               if (drawable && drawable->loaderPrivate)
+                       dri2->flushFrontBuffer(drawable, drawable->loaderPrivate);
        }
 }