Added check against any empty _segments to avoid undefined behaviour

This commit is contained in:
Robert Osfield 2019-07-12 17:00:20 +01:00
parent ab95a79540
commit faa2b1d964

View File

@ -1092,6 +1092,8 @@ struct LineConstructor
void copyPoints(ElevationSlice::Vec3dList& intersections, ElevationSlice::DistanceHeightList& distanceHeightIntersections)
{
if (_segments.empty()) return;
SegmentSet::iterator prevItr = _segments.begin();
SegmentSet::iterator nextItr = prevItr;
++nextItr;