From 505724c5f3e4fc1475fa54f20d08c0c06fb32443 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 7 Jun 2010 16:28:34 -0700 Subject: In DRI2Connect, check to see if DRI2 has been initialized (bug 28424) This prevents DRI2GetScreen from being invoked with an uninitialized private key which would cause an assert failure. Signed-off-by: Keith Packard Tested-by: David Ronis --- hw/xfree86/dri2/dri2.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'hw/xfree86/dri2/dri2.c') diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c index 27d8e2537..a8dedfa6a 100644 --- a/hw/xfree86/dri2/dri2.c +++ b/hw/xfree86/dri2/dri2.c @@ -957,8 +957,12 @@ Bool DRI2Connect(ScreenPtr pScreen, unsigned int driverType, int *fd, const char **driverName, const char **deviceName) { - DRI2ScreenPtr ds = DRI2GetScreen(pScreen); + DRI2ScreenPtr ds; + + if (!dixPrivateKeyRegistered(dri2ScreenPrivateKey)) + return FALSE; + ds = DRI2GetScreen(pScreen); if (ds == NULL || driverType >= ds->numDrivers || !ds->driverNames[driverType]) return FALSE; -- cgit v1.2.3