diff --git a/src/cairo-bentley-ottmann-rectangular.c b/src/cairo-bentley-ottmann-rectangular.c index 5541bdc..fc8b1e9 100644 --- a/src/cairo-bentley-ottmann-rectangular.c +++ b/src/cairo-bentley-ottmann-rectangular.c @@ -554,8 +554,10 @@ sweep_line_delete_edge (sweep_line_t *sweep, edge_t *edge) if (sweep->cursor == edge) sweep->cursor = edge->prev; - edge->prev->next = edge->next; - edge->next->prev = edge->prev; + if (edge->prev) + edge->prev->next = edge->next; + if (edge->next) + edge->next->prev = edge->prev; } static inline cairo_bool_t