summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <daenzer@vmware.com>2009-06-23 16:45:39 +0200
committerMichel Dänzer <daenzer@vmware.com>2009-06-23 16:45:39 +0200
commitdf597709d71f47b8516e27c6fb1bfffd59de5e48 (patch)
tree41a74300d8b943d6a2d4f9220934bac30e2abba0
parent048697ccfa31cf7f7a29afa90a2f702d43efb7d4 (diff)
dri2: Don't crash if pPriv is NULL.
-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,
186 int need_fake_front = 0; 186 int need_fake_front = 0;
187 int have_fake_front = 0; 187 int have_fake_front = 0;
188 int front_format = 0; 188 int front_format = 0;
189 const int dimensions_match = (pDraw->width == pPriv->width) 189 int dimensions_match;
190 && (pDraw->height == pPriv->height);
191 int i; 190 int i;
192 191
192 if (!pPriv) {
193 *width = pDraw->width;
194 *height = pDraw->height;
195 *out_count = 0;
196 return NULL;
197 }
198
199 dimensions_match = (pDraw->width == pPriv->width)
200 && (pDraw->height == pPriv->height);
193 201
194 buffers = xalloc((count + 1) * sizeof(buffers[0])); 202 buffers = xalloc((count + 1) * sizeof(buffers[0]));
195 203