diff --git a/src/cairo-bentley-ottmann-rectangular.c b/src/cairo-bentley-ottmann-rectangular.c index 65f95d797..5bca289cd 100644 --- a/src/cairo-bentley-ottmann-rectangular.c +++ b/src/cairo-bentley-ottmann-rectangular.c @@ -468,6 +468,9 @@ active_edges_to_traps (sweep_line_t *sweep) edge_t *left, *right; int winding; + if (unlikely (pos == NULL)) + break; + left = pos; winding = left->dir; @@ -503,6 +506,8 @@ active_edges_to_traps (sweep_line_t *sweep) * boxes. */ winding += right->dir; + if (unlikely (right->next == NULL)) + break; if (winding == 0 && right->x != right->next->x) break;