From a0ec977944b7659a3fee7a97ce2e650d775bdf8e Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 16 Sep 2011 12:35:45 +0100 Subject: [PATCH] bentley-ottman: End subsumed colinear traps I'm not quite sure how we end up with a pair of colinear edges both with a deferred trap... Fixes crash in bug-bo-ricotz Signed-off-by: Chris Wilson --- src/cairo-bentley-ottmann.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/cairo-bentley-ottmann.c b/src/cairo-bentley-ottmann.c index 634da6f1a..f30449eef 100644 --- a/src/cairo-bentley-ottmann.c +++ b/src/cairo-bentley-ottmann.c @@ -1434,12 +1434,18 @@ _active_edges_to_traps (cairo_bo_edge_t *pos, left = pos; while (pos != NULL) { if (pos != left && pos->deferred_trap.right) { - if (edges_colinear (left, pos)) { + /* XXX It shouldn't be possible to here with 2 deferred traps + * on colinear edges... See bug-bo-rictoz. + */ + if (left->deferred_trap.right == NULL && + edges_colinear (left, pos)) + { /* continuation on left */ - assert (left->deferred_trap.right == NULL); left->deferred_trap = pos->deferred_trap; pos->deferred_trap.right = NULL; - } else { + } + else + { status = _cairo_bo_edge_end_trap (pos, top, traps); if (unlikely (status)) return status;