]> granicus.if.org Git - graphviz/commitdiff
reallyroutespline: fix unchecked failures on recursion
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Tue, 28 Jun 2022 01:20:24 +0000 (18:20 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 3 Jul 2022 04:40:20 +0000 (21:40 -0700)
lib/pathplan/route.c

index ac81eabd03056d904e8cce67bd00a962208c5b07..16378226255db6090ac75f73c0ea43ced3ae989f 100644 (file)
@@ -142,9 +142,13 @@ static int reallyroutespline(Pedge_t * edges, int edgen,
     splitv1 = normv(sub(inps[spliti], inps[spliti - 1]));
     splitv2 = normv(sub(inps[spliti + 1], inps[spliti]));
     splitv = normv(add(splitv1, splitv2));
-    reallyroutespline(edges, edgen, inps, spliti + 1, ev0, splitv);
-    reallyroutespline(edges, edgen, &inps[spliti], inpn - spliti, splitv,
-                     ev1);
+    if (reallyroutespline(edges, edgen, inps, spliti + 1, ev0, splitv) < 0) {
+       return -1;
+    }
+    if (reallyroutespline(edges, edgen, &inps[spliti], inpn - spliti, splitv,
+                          ev1) < 0) {
+       return -1;
+    }
     return 0;
 }