From c9c0e887e781b7de5928343ff8fe398640fdfea3 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Fri, 16 Jan 2015 08:38:30 -0300 Subject: [PATCH] cameo/poly2d.c (paths_to_polys_z): correctly ignore empty paths --- cameo/poly2d.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cameo/poly2d.c b/cameo/poly2d.c index a8d1460..d738e66 100644 --- a/cameo/poly2d.c +++ b/cameo/poly2d.c @@ -1,8 +1,8 @@ /* * poly2d.c - Poly2D interface functions * - * Written 2012 by Werner Almesberger - * Copyright 2012 Werner Almesberger + * Written 2012, 2015 by Werner Almesberger + * Copyright 2012, 2015 Werner Almesberger * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -11,6 +11,7 @@ */ +#include #include #include @@ -46,6 +47,8 @@ struct p2d *paths_to_polys_z(const struct path *paths, if (path->first->z < zmin || path->first->z > zmax) continue; *last = path_to_poly(path); + if (!*last) + continue; last = &(*last)->next; } return polys;