Attempt to fix drawable type checks in dixLookupDrawable().
Not sure this is 100% correct either, but it fixes at least one reproducible crasher where it returned a pixmap to dixLookupWindow().
This commit is contained in:
parent
0b73a7eb17
commit
282a4dcaab
|
@ -219,7 +219,7 @@ dixLookupDrawable(DrawablePtr *pDraw, XID id, ClientPtr client,
|
||||||
pTmp = client->lastDrawable;
|
pTmp = client->lastDrawable;
|
||||||
|
|
||||||
/* an access check is required for cached drawables */
|
/* an access check is required for cached drawables */
|
||||||
rtype = (pTmp->type | M_WINDOW) ? RT_WINDOW : RT_PIXMAP;
|
rtype = (type & M_WINDOW) ? RT_WINDOW : RT_PIXMAP;
|
||||||
if (!XaceHook(XACE_RESOURCE_ACCESS, client, id, rtype, access, pTmp))
|
if (!XaceHook(XACE_RESOURCE_ACCESS, client, id, rtype, access, pTmp))
|
||||||
return BadDrawable;
|
return BadDrawable;
|
||||||
} else
|
} else
|
||||||
|
@ -227,10 +227,10 @@ dixLookupDrawable(DrawablePtr *pDraw, XID id, ClientPtr client,
|
||||||
access);
|
access);
|
||||||
if (!pTmp)
|
if (!pTmp)
|
||||||
return BadDrawable;
|
return BadDrawable;
|
||||||
if (!((1 << pTmp->type) | (type ? type : M_DRAWABLE)))
|
if (!((1 << pTmp->type) & (type ? type : M_DRAWABLE)))
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
|
|
||||||
if (pTmp->type | M_DRAWABLE) {
|
if (type & M_DRAWABLE) {
|
||||||
client->lastDrawable = pTmp;
|
client->lastDrawable = pTmp;
|
||||||
client->lastDrawableID = id;
|
client->lastDrawableID = id;
|
||||||
client->lastGCID = INVALID;
|
client->lastGCID = INVALID;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user