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 all commits
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
3 changes: 3 additions & 0 deletions src/mbgl/layout/symbol_layout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,9 @@ void SymbolLayout::addFeature(const std::size_t layoutFeatureIndex,
}
} else if (type == FeatureType::LineString) {
for (const auto& line : feature.geometry) {
// Skip invalid LineStrings.
tmpsantos marked this conversation as resolved.
Show resolved Hide resolved
if (line.empty()) continue;

Anchor anchor(line[0].x, line[0].y, 0, minScale);
addSymbolInstance(anchor, createSymbolInstanceSharedData(line));
}
Expand Down