diff options
Diffstat (limited to 'src/mbgl/layout/symbol_layout.cpp')
-rw-r--r-- | src/mbgl/layout/symbol_layout.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mbgl/layout/symbol_layout.cpp b/src/mbgl/layout/symbol_layout.cpp index 109f1dffa8..c1eb495838 100644 --- a/src/mbgl/layout/symbol_layout.cpp +++ b/src/mbgl/layout/symbol_layout.cpp @@ -695,8 +695,11 @@ void SymbolLayout::addFeature(const std::size_t layoutFeatureIndex, } } else if (type == FeatureType::LineString) { for (const auto& line : feature.geometry) { - Anchor anchor(line[0].x, line[0].y, 0, minScale); - addSymbolInstance(anchor, createSymbolInstanceSharedData(line)); + // Skip invalid LineStrings. + if (line.size() > 0) { + Anchor anchor(line[0].x, line[0].y, 0, minScale); + addSymbolInstance(anchor, createSymbolInstanceSharedData(line)); + } } } else if (type == FeatureType::Point) { for (const auto& points : feature.geometry) { |