From: Brian Paul Date: Tue, 28 Apr 2009 15:58:44 +0000 (-0600) Subject: i965: avoid segfault in intel_update_renderbuffers() if using DRI1 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=43d9020ff1e975e7f4f9480d9ef24f0b9fb2141f;p=mesa.git i965: avoid segfault in intel_update_renderbuffers() if using DRI1 --- diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index eb224a8a413..a6d8729d8f3 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -198,7 +198,7 @@ intel_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable) struct intel_renderbuffer *rb; struct intel_region *region, *depth_region; struct intel_context *intel = context->driverPrivate; - __DRIbuffer *buffers; + __DRIbuffer *buffers = NULL; __DRIscreen *screen; int i, count; unsigned int attachments[10]; @@ -210,7 +210,8 @@ intel_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable) screen = intel->intelScreen->driScrnPriv; - if ((screen->dri2.loader->base.version > 2) + if (screen->dri2.loader + && (screen->dri2.loader->base.version > 2) && (screen->dri2.loader->getBuffersWithFormat != NULL)) { struct intel_renderbuffer *depth_rb; struct intel_renderbuffer *stencil_rb; @@ -248,7 +249,7 @@ intel_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable) attachments, i / 2, &count, drawable->loaderPrivate); - } else { + } else if (screen->dri2.loader) { i = 0; if (intel_fb->color_rb[0]) attachments[i++] = __DRI_BUFFER_FRONT_LEFT;