Eric Anholt <[email protected]> writes:

> +    /* If the formats don't match, and the pixmap was already uploaded
> +     * (so the dynamic code above doesn't apply), then fall back to
> +     * software.  We should use texture views to fix this properly.
> +     */
> +    if (source_pixmap == mask_pixmap && source->format != mask->format)
> +        goto fail;

source_pixmap is NULL for solid sources. mask_pixmap is NULL for solid
masks or when mask is NULL. In the latter case, this crashes...

From 7bf2affa6c3cad75e4eef939f74d508893d53803 Mon Sep 17 00:00:00 2001
From: Keith Packard <[email protected]>
Date: Mon, 21 Apr 2014 14:54:40 -0700
Subject: [PATCH] Only perform the mask comparison when both mask and source
 are pixmaps

---
 glamor/glamor_render.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/glamor/glamor_render.c b/glamor/glamor_render.c
index 56afc38..bed5161 100644
--- a/glamor/glamor_render.c
+++ b/glamor/glamor_render.c
@@ -1038,11 +1038,11 @@ glamor_composite_choose_shader(CARD8 op,
     }
 #endif
 
-    /* If the formats don't match, and the pixmap was already uploaded
+    /* If the formats don't match, and the pixmaps were already uploaded
      * (so the dynamic code above doesn't apply), then fall back to
      * software.  We should use texture views to fix this properly.
      */
-    if (source_pixmap == mask_pixmap && source->format != mask->format)
+    if (source_pixmap && source_pixmap == mask_pixmap && source->format != mask->format)
         goto fail;
 
     /*Before enter the rendering stage, we need to fixup
-- 
1.9.2

-- 
[email protected]

Attachment: pgpgDPXBSwEtn.pgp
Description: PGP signature

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to