From: Matthew Fernandez Date: Sat, 24 Apr 2021 03:09:28 +0000 (-0700) Subject: anticipate a -2 return from seg_cmp indicating an error X-Git-Tag: 2.47.2~13^2~22 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=78c73bcde985e50b2c0f27b34e03e86736a37aa1;p=graphviz anticipate a -2 return from seg_cmp indicating an error Related to #1801. --- diff --git a/lib/ortho/ortho.c b/lib/ortho/ortho.c index becbf37a0..7926b5929 100644 --- a/lib/ortho/ortho.c +++ b/lib/ortho/ortho.c @@ -756,9 +756,11 @@ add_edges_in_G(channel* cp) for(x=0;x+1 0) { + if (cmp == -2) { + return -1; + } else if (cmp > 0) { insert_edge(G,x,y); - } else if (cmp < 0) { + } else if (cmp == -1) { insert_edge(G,y,x); } } @@ -868,6 +870,9 @@ decide_point(pair *ret, segment* si, segment* sj, int dir1, int dir2) assert(0); /* FIXME */ else { temp = seg_cmp(np1, np2); + if (temp == -2) { + return -1; + } prec = propagate_prec(np1, temp, ans+1, 1-dir1); }