Fix memory access violation exception in vector_tile_data.cpp (#632)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include <mbgl/tile/vector_tile_data.hpp>
|
||||
#include <mbgl/util/constants.hpp>
|
||||
#include <mbgl/util/logging.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
@@ -40,7 +41,15 @@ FeatureIdentifier VectorTileFeature::getID() const {
|
||||
const GeometryCollection& VectorTileFeature::getGeometries() const {
|
||||
if (!lines) {
|
||||
const auto scale = static_cast<float>(util::EXTENT) / feature.getExtent();
|
||||
lines = feature.getGeometries<GeometryCollection>(scale);
|
||||
|
||||
try {
|
||||
lines = feature.getGeometries<GeometryCollection>(scale);
|
||||
}
|
||||
catch(const std::runtime_error& ex) {
|
||||
Log::Error(Event::ParseTile, "Could not get geometries: %s", ex.what());
|
||||
lines = GeometryCollection();
|
||||
}
|
||||
|
||||
if (feature.getVersion() < 2 && feature.getType() == mapbox::vector_tile::GeomType::POLYGON) {
|
||||
lines = fixupPolygons(*lines);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user