diff --git a/glx/glxscreens.c b/glx/glxscreens.c index 6f68b066a..2b12049fb 100644 --- a/glx/glxscreens.c +++ b/glx/glxscreens.c @@ -254,6 +254,7 @@ AddScreenVisuals(ScreenPtr pScreen, int count, int d) VisualPtr visuals; ColormapPtr installedCmap; DepthPtr depth; + int rc; depth = NULL; for (i = 0; i < pScreen->numDepths; i++) { @@ -294,8 +295,10 @@ AddScreenVisuals(ScreenPtr pScreen, int count, int d) * for all colormaps. */ for (i = 0; i < numInstalledCmaps; i++) { - installedCmap = LookupIDByType (installedCmaps[i], RT_COLORMAP); - if (!installedCmap) + rc = dixLookupResourceByType((pointer *)&installedCmap, + installedCmaps[i], RT_COLORMAP, + serverClient, DixReadAccess); + if (rc != Success) continue; j = installedCmap->pVisual - pScreen->visuals; installedCmap->pVisual = &visuals[j]; diff --git a/glx/xfont.c b/glx/xfont.c index 1f4ecbd4d..b8b466d87 100644 --- a/glx/xfont.c +++ b/glx/xfont.c @@ -180,12 +180,17 @@ int __glXDisp_UseXFont(__GLXclientState *cl, GLbyte *pc) ** Font can actually be either the ID of a font or the ID of a GC ** containing a font. */ - pFont = (FontPtr)LookupIDByType(req->font, RT_FONT); - if (!pFont) { - pGC = (GC *)LookupIDByType(req->font, RT_GC); - if (!pGC) { + + error = dixLookupResourceByType((pointer *)&pFont, + req->font, RT_FONT, + client, DixReadAccess); + if (error != Success) { + error = dixLookupResourceByType((pointer *)&pGC, + req->font, RT_GC, + client, DixReadAccess); + if (error != Success) { client->errorValue = req->font; - return BadFont; + return error == BadGC ? BadFont : error; } pFont = pGC->font; }