Don't allow setting the alpha map of a picture to itself, or to a
picture that already has an alpha map, to prevent cycles.

Signed-off-by: Adam Jackson <a...@redhat.com>
---
 render/picture.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/render/picture.c b/render/picture.c
index 48693b8..902cc20 100644
--- a/render/picture.c
+++ b/render/picture.c
@@ -1119,7 +1119,9 @@ ChangePicture (PicturePtr pPicture,
                            break;
                        }
                        if (pAlpha->pDrawable == NULL ||
-                           pAlpha->pDrawable->type != DRAWABLE_PIXMAP)
+                           pAlpha->pDrawable->type != DRAWABLE_PIXMAP ||
+                           pAlpha == pPicture ||
+                           pAlpha->alphaMap != NULL)
                        {
                            client->errorValue = pid;
                            error = BadMatch;
-- 
1.7.0.1

_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to