[GRASS-SVN] r31625 - grass/trunk/visualization/nviz/src
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Jun 4 05:24:32 EDT 2008
Author: martinl
Date: 2008-06-04 05:24:32 -0400 (Wed, 04 Jun 2008)
New Revision: 31625
Modified:
grass/trunk/visualization/nviz/src/map_obj.c
grass/trunk/visualization/nviz/src/nviz_init.c
Log:
nviz: avoid crashing on elevation map not found (merge devbr6, r31624)
Modified: grass/trunk/visualization/nviz/src/map_obj.c
===================================================================
--- grass/trunk/visualization/nviz/src/map_obj.c 2008-06-04 09:22:04 UTC (rev 31624)
+++ grass/trunk/visualization/nviz/src/map_obj.c 2008-06-04 09:24:32 UTC (rev 31625)
@@ -471,7 +471,10 @@
arglist[2] = topo_string;
if ((argc >= 3) && (strncmp(argv[2], "name=", 5))) {
arglist[3] = argv[2];
- set_att(new_id, SURF, data, interp, 3, arglist);
+ if (set_att(new_id, SURF, data, interp, 3, arglist) != TCL_OK) {
+ GS_delete_surface(new_id);
+ return (TCL_ERROR);
+ }
file_used = 1;
}
else {
@@ -1749,6 +1752,9 @@
G_debug(3, "Loading attribute map %s\n", argv[3]);
ret = GS_load_att_map(id, argv[3], att);
+ if (ret < 0) {
+ return TCL_ERROR;
+ }
}
/* After we've loaded a constant map or a file,
Modified: grass/trunk/visualization/nviz/src/nviz_init.c
===================================================================
--- grass/trunk/visualization/nviz/src/nviz_init.c 2008-06-04 09:22:04 UTC (rev 31624)
+++ grass/trunk/visualization/nviz/src/nviz_init.c 2008-06-04 09:24:32 UTC (rev 31625)
@@ -288,8 +288,12 @@
for (i = 0; elev->answers[i]; i++) {
arglist[1] = "surf";
arglist[2] = elev->answers[i];
- Nnew_map_obj_cmd(data, interp, 3, arglist);
+ if (Nnew_map_obj_cmd(data, interp, 3, arglist) != TCL_OK) {
+ G_warning(_("Loading data failed"));
+ continue;
+ }
+
/* See if we should autoload the color file */
if (aload) {
strncpy(tmp, interp->result, 29);
More information about the grass-commit
mailing list