Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Fix segfault resulting from an invalid geometry. #16409

Merged
merged 2 commits into from
Apr 17, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/mbgl/layout/symbol_layout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
tmpsantos marked this conversation as resolved.
Show resolved Hide resolved
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) {
Expand Down