diff options
author | Michel Dänzer <daenzer@vmware.com> | 2009-06-23 16:45:39 +0200 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2009-09-22 12:04:27 -0700 |
commit | f5d1da499c3d64f0a4ac217eb19911b8e35cb49b (patch) | |
tree | 19e548affa2110bf3edaa48029148f69fe6cc8aa | |
parent | 468787bdd2c34f9edf46da76b6357034c216fa7b (diff) |
dri2: Don't crash if pPriv is NULL.
(cherry picked from commit df597709d71f47b8516e27c6fb1bfffd59de5e48)
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r-- | hw/xfree86/dri2/dri2.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c index 580383dbc..3e8a7d4a8 100644 --- a/hw/xfree86/dri2/dri2.c +++ b/hw/xfree86/dri2/dri2.c @@ -190,10 +190,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])); |