aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/xfixes/region.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/xfixes/region.c')
-rw-r--r--xorg-server/xfixes/region.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/xorg-server/xfixes/region.c b/xorg-server/xfixes/region.c
index cc8f1a5ef..f9de52542 100644
--- a/xorg-server/xfixes/region.c
+++ b/xorg-server/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);
}