From ba2432a020a9f9bd0892f643117795336ba0fc16 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Thu, 10 Apr 2014 11:34:28 -0400 Subject: xfixes: Forbid manipulating clip for source-only pictures (#28968) Just throw BadPicture instead of crashing. It's not currently a meaningful thing to do anyway, RenderSetPictureRectangles would error if you tried (which this patch changes to BadPicture as well for consistency). The problem with trying to do it is if the clip is specified as a pixmap then we try to convert it to a region, and ->BitmapToRegion requires a ScreenPtr, and source-only pictures don't have one. I can imagine a use for client clip on source-only pictures, so if we really wanted to allow this, probably the way forward is to always store the clip as a region internally, and when setting the clip _from_ a pixmap, look up BitmapToRegion relative to the pixmap not the picture. But since clearly nobody can be relying on it working... Signed-off-by: Adam Jackson Reviewed-by: Hans de Goede Reviewed-by: Keith Packard Signed-off-by: Keith Packard --- render/render.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'render') diff --git a/render/render.c b/render/render.c index 3b7151a69..9ac4a98e7 100644 --- a/render/render.c +++ b/render/render.c @@ -638,7 +638,7 @@ ProcRenderSetPictureClipRectangles(ClientPtr client) REQUEST_AT_LEAST_SIZE(xRenderSetPictureClipRectanglesReq); VERIFY_PICTURE(pPicture, stuff->picture, client, DixSetAttrAccess); if (!pPicture->pDrawable) - return BadDrawable; + return RenderErrBase + BadPicture; nr = (client->req_len << 2) - sizeof(xRenderSetPictureClipRectanglesReq); if (nr & 4) -- cgit v1.2.3