From d4b2403f271bb8af37b7bb856b8406acc14721a8 Mon Sep 17 00:00:00 2001 In-Reply-To: References: From: James Cloos Date: Thu, 23 Jun 2011 00:10:09 -0400 Subject: [PATCH 1/1] Complete fix to intersect_with_boxes(). To: cairo@cairographics.org The old code forgot to dereference the boxes pointer. Signed-off-by: James Cloos --- src/cairo-clip.c | 22 ++++++++++++---------- 1 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/cairo-clip.c b/src/cairo-clip.c index b03e27c..60c592d 100644 --- a/src/cairo-clip.c +++ b/src/cairo-clip.c @@ -1402,16 +1402,18 @@ intersect_with_boxes (cairo_composite_rectangles_t *extents, /* Find the extents over all the clip boxes */ box.p1.x = box.p1.y = INT_MAX; box.p2.x = box.p2.y = INT_MIN; - while (num_boxes--) { - if (boxes->p1.x < box.p1.x) - box.p1.x = boxes->p1.x; - if (boxes->p1.y < box.p1.y) - box.p1.y = boxes->p1.y; - - if (boxes->p2.x > box.p2.x) - box.p2.x = boxes->p2.x; - if (boxes->p2.y > box.p2.y) - box.p2.y = boxes->p2.y; + while (num_boxes) { + num_boxes--; + + if (boxes[num_boxes].p1.x < box.p1.x) + box.p1.x = boxes[num_boxes].p1.x; + if (boxes[num_boxes].p1.y < box.p1.y) + box.p1.y = boxes[num_boxes].p1.y; + + if (boxes[num_boxes].p2.x > box.p2.x) + box.p2.x = boxes[num_boxes].p2.x; + if (boxes[num_boxes].p2.y > box.p2.y) + box.p2.y = boxes[num_boxes].p2.y; } _cairo_box_round_to_rectangle (&box, &rect); -- 1.7.5.3