浏览代码

dig_angle_next_line(): avoid segfault on dead line

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@54090 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 12 年之前
父节点
当前提交
e63d377e94
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      lib/vector/diglib/plus_area.c

+ 6 - 1
lib/vector/diglib/plus_area.c

@@ -570,7 +570,12 @@ dig_angle_next_line(struct Plus_head *plus, plus_t current_line, int side,
 
 	line = abs(Node->lines[next]);
 	Line = plus->Line[line];
-
+        if (!Line) {
+            G_warning(_("Unable to find next line for %d. Dead line found."),
+                      current_line);
+            return 0;
+        }
+        
 	if (Line->type & type) {	/* line found */
 	    G_debug(3, "  this one");
 	    if (angle)