From 2414a1de3cc17f438219f8f2a58b530d33e99a5e Mon Sep 17 00:00:00 2001 From: marha Date: Fri, 6 Sep 2013 12:06:57 +0200 Subject: mesa pixman xserver xkeyboard-config xserver commit 6f89ae3e64c4dfeea508813e546c10ba1da3ea8e xkeyboard-config commit c2309b50e7ef7b9263278fd8ff73dda1484d72db pixman commit 8ad63f90cd8392a40f115c56b16c54d45012070e mesa commit 505fad04f10eee1efdfcd8986b4d484b49d39986 --- xorg-server/dix/dispatch.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'xorg-server/dix') diff --git a/xorg-server/dix/dispatch.c b/xorg-server/dix/dispatch.c index 51d0de25f..71fda4893 100644 --- a/xorg-server/dix/dispatch.c +++ b/xorg-server/dix/dispatch.c @@ -2864,18 +2864,25 @@ ProcCreateCursor(ClientPtr client) return rc; } - rc = dixLookupResourceByType((pointer *) &msk, stuff->mask, RT_PIXMAP, - client, DixReadAccess); - if (rc != Success) { - if (stuff->mask != None) { + if (src->drawable.depth != 1) + return (BadMatch); + + /* Find and validate cursor mask pixmap, if one is provided */ + if (stuff->mask != None) { + rc = dixLookupResourceByType((pointer *) &msk, stuff->mask, RT_PIXMAP, + client, DixReadAccess); + if (rc != Success) { client->errorValue = stuff->mask; return rc; } + + if (src->drawable.width != msk->drawable.width + || src->drawable.height != msk->drawable.height + || src->drawable.depth != 1 || msk->drawable.depth != 1) + return BadMatch; } - else if (src->drawable.width != msk->drawable.width - || src->drawable.height != msk->drawable.height - || src->drawable.depth != 1 || msk->drawable.depth != 1) - return BadMatch; + else + msk = NULL; width = src->drawable.width; height = src->drawable.height; -- cgit v1.2.3