Permalink
Browse files

segfault on NULL item type

  • Loading branch information...
tbonfort committed Sep 17, 2015
1 parent 2597714 commit ab544816b8da3eff25a5e8960d0bbdaaec827ad4
Showing with 3 additions and 3 deletions.
  1. +3 −3 mapmvt.c
@@ -177,13 +177,13 @@ int mvtWriteShape( layerObj *layer, shapeObj *shape, VectorTile__Tile__Layer *mv
mvt_value = mvt_layer->values[mvt_layer->n_values-1];
vector_tile__tile__value__init(mvt_value);
if( EQUAL(item->type,"Integer")) {
if( item->type && EQUAL(item->type,"Integer")) {
mvt_value->int_value = atoi(value->value);
mvt_value->has_int_value = 1;
} else if( EQUAL(item->type,"Real") ) {
} else if( item->type && EQUAL(item->type,"Real") ) {
mvt_value->float_value = atof(value->value);
mvt_value->has_float_value = 1;
} else if( EQUAL(item->type,"Boolean") ) {
} else if( item->type && EQUAL(item->type,"Boolean") ) {
if(EQUAL(value->value,"0") || EQUAL(value->value,"false"))
mvt_value->bool_value = 0;
else

0 comments on commit ab54481

Please sign in to comment.