[Pixman] [PATCH 3/3] pixman_composite_trapezoids(): Check for NULL return from create_bits()

Søren Sandmann sandmann at cs.au.dk
Thu Dec 13 13:14:04 PST 2012


From: Søren Sandmann Pedersen <ssp at redhat.com>

A check is needed that the creation of the temporary image in
pixman_composite_trapezoids() succeeds.

Fixes crash in stress-test -s 0x313c on my system.
---
 pixman/pixman-trap.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/pixman/pixman-trap.c b/pixman/pixman-trap.c
index 4dad179..91766fd 100644
--- a/pixman/pixman-trap.c
+++ b/pixman/pixman-trap.c
@@ -523,8 +523,9 @@ pixman_composite_trapezoids (pixman_op_t		op,
 	if (!get_trap_extents (op, dst, traps, n_traps, &box))
 	    return;
 	
-	tmp = pixman_image_create_bits (
-	    mask_format, box.x2 - box.x1, box.y2 - box.y1, NULL, -1);
+	if (!(tmp = pixman_image_create_bits (
+		  mask_format, box.x2 - box.x1, box.y2 - box.y1, NULL, -1)))
+	    return;
 	
 	for (i = 0; i < n_traps; ++i)
 	{
-- 
1.7.11.7



More information about the Pixman mailing list