diff options
author | Keith Packard <keithp@keithp.com> | 2010-06-07 16:28:34 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2010-06-15 15:24:00 -0700 |
commit | 505724c5f3e4fc1475fa54f20d08c0c06fb32443 (patch) | |
tree | e20fbb9367c528dffced31c7d01a8b8d747e3430 /hw/xfree86/dri2 | |
parent | 68a9ee8370e6f9b38218376ac92d5130a5b0ef1e (diff) |
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 <keithp@keithp.com>
Tested-by: David Ronis <David.Ronis@McGill.CA>
Diffstat (limited to 'hw/xfree86/dri2')
-rw-r--r-- | hw/xfree86/dri2/dri2.c | 6 |
1 files changed, 5 insertions, 1 deletions
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; |