diff options
author | Keith Packard <keithp@keithp.com> | 2005-05-12 20:25:07 +0000 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2005-05-12 20:25:07 +0000 |
commit | 949daa1bc98cdd34a6c3d7b3ca69fd06e88883e4 (patch) | |
tree | 88ca71b96a9c3e45b57e08cdb1df69d94260917d | |
parent | 27d9c575a77e0b6dc995e348c4877bc0092a4571 (diff) |
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
-rw-r--r-- | pixman/ChangeLog | 9 | ||||
-rw-r--r-- | pixman/src/ictrap.c | 13 |
2 files changed, 17 insertions, 5 deletions
diff --git a/pixman/ChangeLog b/pixman/ChangeLog index d3c555334..af0b96cf1 100644 --- a/pixman/ChangeLog +++ b/pixman/ChangeLog @@ -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 diff --git a/pixman/src/ictrap.c b/pixman/src/ictrap.c index 31e0539ef..0fcd59b33 100644 --- a/pixman/src/ictrap.c +++ b/pixman/src/ictrap.c @@ -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++) { |