diff options
author | Tormod Volden <debian.tormod@gmail.com> | 2009-05-12 09:32:11 +0200 |
---|---|---|
committer | Jerome Glisse <glisse@freedesktop.org> | 2009-05-12 12:43:08 +0200 |
commit | 0bfa8dfaaf49703eb5c3237b5cae6201b8755e4d (patch) | |
tree | 5b0a11f7b9202ff04ba93980c2f4f15562e76637 /src/mesa/drivers/dri | |
parent | 98bb5c610dc68d8e9a185216ce9d2dc6d278c114 (diff) |
radeon: avoid segfault in radeon_update_renderbuffers() if using DRI1
Basically the same as 43d9020ff1e975e7f4f9480d9ef24f0b9fb2141f for intel. Bug 21688.
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_common_context.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_common_context.c b/src/mesa/drivers/dri/radeon/radeon_common_context.c index 124b587bab..6fb6f92cb9 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_common_context.c @@ -428,7 +428,7 @@ void radeon_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable) { unsigned int attachments[10]; - __DRIbuffer *buffers; + __DRIbuffer *buffers = NULL; __DRIscreen *screen; struct radeon_renderbuffer *rb; int i, count; @@ -444,7 +444,8 @@ radeon_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable) screen = context->driScreenPriv; radeon = (radeonContextPtr) context->driverPrivate; - if ((screen->dri2.loader->base.version > 2) + if (screen->dri2.loader + && (screen->dri2.loader->base.version > 2) && (screen->dri2.loader->getBuffersWithFormat != NULL)) { struct radeon_renderbuffer *depth_rb; struct radeon_renderbuffer *stencil_rb; @@ -481,7 +482,7 @@ radeon_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable) attachments, i / 2, &count, drawable->loaderPrivate); - } else { + } else if (screen->dri2.loader) { i = 0; if (draw->color_rb[0]) attachments[i++] = __DRI_BUFFER_FRONT_LEFT; |