[GRASS-SVN] r73819 - grass/branches/releasebranch_7_4/vector/v.out.ogr

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Dec 20 10:51:11 PST 2018


Author: mmetz
Date: 2018-12-20 10:51:10 -0800 (Thu, 20 Dec 2018)
New Revision: 73819

Modified:
   grass/branches/releasebranch_7_4/vector/v.out.ogr/main.c
Log:
v.out.ogr: fix #3714, segfault with -n (backport trunk r73817)

Modified: grass/branches/releasebranch_7_4/vector/v.out.ogr/main.c
===================================================================
--- grass/branches/releasebranch_7_4/vector/v.out.ogr/main.c	2018-12-20 18:50:55 UTC (rev 73818)
+++ grass/branches/releasebranch_7_4/vector/v.out.ogr/main.c	2018-12-20 18:51:10 UTC (rev 73819)
@@ -127,6 +127,7 @@
        Centroids, Boundaries and Kernels always have to be exported
        explicitly, using the "type=" option.
      */
+    field = 0;
     if (!flags.new->answer) {
 	/* open input vector (topology required) */
 	Vect_set_open_level(2);
@@ -188,10 +189,9 @@
 		G_warning(_("Unable to determine input map's vector feature type(s)."));
             }
 	}
+	field = Vect_get_field_number(&In, options.field->answer);
     }
 
-    field = Vect_get_field_number(&In, options.field->answer);
-
     /* check output feature type */
     otype = Vect_option_to_types(options.type);
     ftype = Vect_option_to_types(options.otype);



More information about the grass-commit mailing list