summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hw/xfree86/dri2/dri2.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index 385c5e8d4..aead33b66 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -186,10 +186,18 @@ do_get_buffers(DrawablePtr pDraw, int *width, int *height,
int need_fake_front = 0;
int have_fake_front = 0;
int front_format = 0;
- const int dimensions_match = (pDraw->width == pPriv->width)
- && (pDraw->height == pPriv->height);
+ int dimensions_match;
int i;
+ if (!pPriv) {
+ *width = pDraw->width;
+ *height = pDraw->height;
+ *out_count = 0;
+ return NULL;
+ }
+
+ dimensions_match = (pDraw->width == pPriv->width)
+ && (pDraw->height == pPriv->height);
buffers = xalloc((count + 1) * sizeof(buffers[0]));