summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--render/render.c2
-rw-r--r--xfixes/region.c6
2 files changed, 7 insertions, 1 deletions
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)
diff --git a/xfixes/region.c b/xfixes/region.c
index cc8f1a5ef..f9de52542 100644
--- a/xfixes/region.c
+++ b/xfixes/region.c
@@ -269,6 +269,9 @@ ProcXFixesCreateRegionFromPicture(ClientPtr client)
VERIFY_PICTURE(pPicture, stuff->picture, client, DixGetAttrAccess);
+ if (!pPicture->pDrawable)
+ return RenderErrBase + BadPicture;
+
switch (pPicture->clientClipType) {
case CT_PIXMAP:
pRegion = BitmapToRegion(pPicture->pDrawable->pScreen,
@@ -750,6 +753,9 @@ ProcXFixesSetPictureClipRegion(ClientPtr client)
VERIFY_PICTURE(pPicture, stuff->picture, client, DixSetAttrAccess);
VERIFY_REGION_OR_NONE(pRegion, stuff->region, client, DixReadAccess);
+ if (!pPicture->pDrawable)
+ return RenderErrBase + BadPicture;
+
return SetPictureClipRegion(pPicture, stuff->xOrigin, stuff->yOrigin,
pRegion);
}