PKGBUILDs/extra/xorg-server/dri2-dontcrash.patch
2009-10-09 21:23:22 -05:00

33 lines
946 B
Diff

From df597709d71f47b8516e27c6fb1bfffd59de5e48 Mon Sep 17 00:00:00 2001
From: Michel Dänzer <daenzer@vmware.com>
Date: Tue, 23 Jun 2009 14:45:39 +0000
Subject: dri2: Don't crash if pPriv is NULL.
---
diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index 385c5e8..aead33b 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]));
--
cgit v0.8.2