diff options
author | Michel Dänzer <michel@tungstengraphics.com> | 2007-01-08 19:22:41 +0100 |
---|---|---|
committer | Michel Dänzer <michel@tungstengraphics.com> | 2007-01-08 19:22:41 +0100 |
commit | 282a4dcaabc5f0cd6f7d3819aa648333b93b265e (patch) | |
tree | 863ee4a8f358f23a9bbbbf00ebc7c0f2a6ccbea3 /dix | |
parent | 0b73a7eb17fd848c6bdc6a65ba835aa2cbfc3cfd (diff) |
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().
Diffstat (limited to 'dix')
-rw-r--r-- | dix/dixutils.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/dix/dixutils.c b/dix/dixutils.c index 084d2e4c5..e530360fe 100644 --- a/dix/dixutils.c +++ b/dix/dixutils.c @@ -219,7 +219,7 @@ dixLookupDrawable(DrawablePtr *pDraw, XID id, ClientPtr client, pTmp = client->lastDrawable; /* 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)) return BadDrawable; } else @@ -227,10 +227,10 @@ dixLookupDrawable(DrawablePtr *pDraw, XID id, ClientPtr client, access); if (!pTmp) return BadDrawable; - if (!((1 << pTmp->type) | (type ? type : M_DRAWABLE))) + if (!((1 << pTmp->type) & (type ? type : M_DRAWABLE))) return BadMatch; - if (pTmp->type | M_DRAWABLE) { + if (type & M_DRAWABLE) { client->lastDrawable = pTmp; client->lastDrawableID = id; client->lastGCID = INVALID; |