pixman: Branch 'master' - 2 commits

Søren Sandmann Pedersen sandmann at kemper.freedesktop.org
Wed Jul 8 16:00:09 PDT 2009


 pixman/pixman-region.c |    4 ++--
 test/region-test.c     |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 31a40a172591ab373add9dd41a52881bea9dc6f2
Author: Søren Sandmann Pedersen <sandmann at redhat.com>
Date:   Wed Jul 8 18:41:41 2009 -0400

    Eliminate boxes with x1 > x2 or y1 > y2 in pixman_region_init_rects().

diff --git a/pixman/pixman-region.c b/pixman/pixman-region.c
index 0e1791c..e5a92ef 100644
--- a/pixman/pixman-region.c
+++ b/pixman/pixman-region.c
@@ -2122,14 +2122,14 @@ PREFIX(_init_rects) (region_type_t *region,
     memcpy (rects, boxes, sizeof(box_type_t) * count);
     region->data->numRects = count;
 
-    /* Eliminate empty rectangles */
+    /* Eliminate empty and malformed rectangles */
     displacement = 0;
     
     for (i = 0; i < count; ++i)
     {
 	box_type_t *box = &rects[i];
 
-	if (box->x1 == box->x2 || box->y1 == box->y2)
+	if (box->x1 >= box->x2 || box->y1 >= box->y2)
 	    displacement++;
 	else if (displacement)
 	    rects[i - displacement] = rects[i];
commit 706e6594310a490956d21e939c23de2b5dbe1561
Author: Søren Sandmann Pedersen <sandmann at redhat.com>
Date:   Wed Jul 8 18:39:43 2009 -0400

    Add a box with y2 < y1 in region-test.c

diff --git a/test/region-test.c b/test/region-test.c
index a1e7cbc..e9a6421 100644
--- a/test/region-test.c
+++ b/test/region-test.c
@@ -12,6 +12,7 @@ main ()
     pixman_box32_t boxes[] = {
 	{ 10, 10, 20, 20 },
 	{ 30, 30, 30, 40 },
+	{ 50, 45, 60, 44 },
     };
     int i;
     pixman_box32_t *b;
@@ -31,7 +32,7 @@ main ()
      * but using an empty rectangle for initialization should
      * work.
      */
-    pixman_region32_init_rects (&r1, boxes, 2);
+    pixman_region32_init_rects (&r1, boxes, 3);
 
     b = pixman_region32_rectangles (&r1, &i);
 
@@ -45,4 +46,3 @@ main ()
 
     return 0;
 }
-


More information about the xorg-commit mailing list