libpixman creates an A8 format object and sometimes forgets to destroy (when the bounds of the trapezoids are empty). Avoids creating the format object in that case.

reviewed by: cworth
This commit is contained in:
Keith Packard 2005-05-12 20:25:07 +00:00
parent 27d9c575a7
commit 949daa1bc9
2 changed files with 17 additions and 5 deletions

View file

@ -1,3 +1,12 @@
2005-05-12 Keith Packard <keithp@keithp.com>
reviewed by: cworth
* src/ictrap.c: (pixman_composite_trapezoids):
libpixman creates an A8 format object and sometimes forgets to
destroy (when the bounds of the trapezoids are empty).
Avoids creating the format object in that case.
2005-04-27 Owen Taylor <otaylor@redhat.com>
* src/icimage.c (pixman_image_set_clip_region): Set

View file

@ -1,5 +1,5 @@
/*
* $Id: ictrap.c,v 1.24 2005-03-04 15:53:09 cworth Exp $
* $Id: ictrap.c,v 1.25 2005-05-13 03:25:07 keithp Exp $
*
* Copyright © 2002 Keith Packard
*
@ -139,10 +139,6 @@ pixman_composite_trapezoids (pixman_operator_t op,
xDst = traps[0].left.p1.x >> 16;
yDst = traps[0].left.p1.y >> 16;
format = pixman_format_create (PIXMAN_FORMAT_NAME_A8);
if (!format)
return;
pixman_trapezoid_bounds (ntraps, traps, &traps_bounds);
traps_region = pixman_region_create_simple (&traps_bounds);
@ -167,11 +163,18 @@ pixman_composite_trapezoids (pixman_operator_t op,
if (bounds.y1 >= bounds.y2 || bounds.x1 >= bounds.x2)
return;
format = pixman_format_create (PIXMAN_FORMAT_NAME_A8);
if (!format)
return;
image = IcCreateAlphaPicture (dst, format,
bounds.x2 - bounds.x1,
bounds.y2 - bounds.y1);
if (!image)
{
pixman_format_destroy (format);
return;
}
for (; ntraps; ntraps--, traps++)
{