diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c index f4fa19edb..4ac0e144e 100644 --- a/hw/xfree86/dri2/dri2.c +++ b/hw/xfree86/dri2/dri2.c @@ -359,10 +359,15 @@ DRI2CreateDrawable2(ClientPtr client, DrawablePtr pDraw, XID id, XID *dri2_id_out) { DRI2DrawablePtr pPriv; - DRI2ClientPtr dri2_client = dri2ClientPrivate(client); + DRI2ClientPtr dri2_client; XID dri2_id; int rc; + if (!dixPrivateKeyRegistered(dri2ScreenPrivateKey)) + return BadValue; + + dri2_client = dri2ClientPrivate(client); + pPriv = DRI2GetDrawable(pDraw); if (pPriv == NULL) pPriv = DRI2AllocateDrawable(pDraw); @@ -1365,9 +1370,14 @@ Bool DRI2Authenticate(ClientPtr client, ScreenPtr pScreen, uint32_t magic) { DRI2ScreenPtr ds; - DRI2ClientPtr dri2_client = dri2ClientPrivate(client); + DRI2ClientPtr dri2_client; ScreenPtr primescreen; + if (!dixPrivateKeyRegistered(dri2ScreenPrivateKey)) + return FALSE; + + dri2_client = dri2ClientPrivate(client); + ds = DRI2GetScreenPrime(pScreen, dri2_client->prime_id); if (ds == NULL) return FALSE;