intel: added screen->dri2.loader null pointer check in intel_flush()
authorBrian Paul <brianp@vmware.com>
Fri, 10 Apr 2009 14:35:21 +0000 (08:35 -0600)
committerBrian Paul <brianp@vmware.com>
Fri, 10 Apr 2009 14:36:19 +0000 (08:36 -0600)
Fixes segfaults when rendering to front buffer.

src/mesa/drivers/dri/intel/intel_context.c

index 56d03c1e78458f6766e1d1329fcfe33272b38f1f..3436b8ecd300d7d324dd2e056008fa6fcf9f6eab 100644 (file)
@@ -400,7 +400,8 @@ intel_flush(GLcontext *ctx, GLboolean needs_mi_flush)
    if ((ctx->DrawBuffer->Name == 0) && intel->front_buffer_dirty) {
       __DRIscreen *const screen = intel->intelScreen->driScrnPriv;
 
-      if ((screen->dri2.loader->base.version >= 2)
+      if (screen->dri2.loader &&
+          (screen->dri2.loader->base.version >= 2)
          && (screen->dri2.loader->flushFrontBuffer != NULL)) {
         (*screen->dri2.loader->flushFrontBuffer)(intel->driDrawable,
                                                  intel->driDrawable->loaderPrivate);