xf86-video-intel: src/sna/sna_trapezoids.c
Chris Wilson
ickle at kemper.freedesktop.org
Thu Sep 1 07:58:44 PDT 2011
src/sna/sna_trapezoids.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
New commits:
commit 695e7115efab96c4467dc926be07dc2609011720
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Thu Sep 1 15:50:29 2011 +0100
sna/trapezoids: Edges may lie out of bounds
We cannot assume that the edge lies completely within the target, so we
must make sure that the initial prev_x is truly less than any possible
value whilst sorting intersections.
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/sna_trapezoids.c b/src/sna/sna_trapezoids.c
index 4dceba9..4698f7f 100644
--- a/src/sna/sna_trapezoids.c
+++ b/src/sna/sna_trapezoids.c
@@ -602,7 +602,7 @@ polygon_init(struct polygon *polygon,
{
unsigned h = ymax - ymin;
unsigned num_buckets =
- EDGE_Y_BUCKET_INDEX(ymax+EDGE_Y_BUCKET_HEIGHT-1, ymin);
+ EDGE_Y_BUCKET_INDEX(ymax+EDGE_Y_BUCKET_HEIGHT-1, ymin);
if (unlikely(h > 0x7FFFFFFFU - EDGE_Y_BUCKET_HEIGHT))
goto bail_no_mem; /* even if you could, you wouldn't want to. */
@@ -862,8 +862,8 @@ inline static void
nonzero_subrow(struct active_list *active, struct cell_list *coverages)
{
struct edge *edge = active->head.next;
- grid_scaled_x_t prev_x = -1;
- int winding = 0, xstart = -1;
+ grid_scaled_x_t prev_x = INT_MIN;
+ int winding = 0, xstart = INT_MIN;
cell_list_rewind (coverages);
@@ -875,7 +875,7 @@ nonzero_subrow(struct active_list *active, struct cell_list *coverages)
if (edge->next->x.quo != edge->x.quo) {
cell_list_add_subspan(coverages,
xstart, edge->x.quo);
- xstart = -1;
+ xstart = INT_MIN;
}
} else if (xstart < 0)
xstart = edge->x.quo;
More information about the xorg-commit
mailing list