Crash in WebCore::translateIntersectionPointsToSkipInkBoundaries
[WebKit-https.git] / Source / WebCore / rendering / InlineTextBox.cpp
index f2522d90d926914d88d1bf7b0d1e2555a39be28f..857cace8a4521b700dcfeabf59a68d0e75c97734 100644 (file)
@@ -86,19 +86,16 @@ static DashArray translateIntersectionPointsToSkipInkBoundaries(const DashArray&
     Vector<std::pair<float, float>> intermediateTuples;
     if (tuples.size() >= 2) {
         intermediateTuples.append(*tuples.begin());
-        auto lastIntermediate = intermediateTuples.begin();
         for (auto i = tuples.begin() + 1; i != tuples.end(); i++) {
-            float& firstEnd = lastIntermediate->second;
+            float& firstEnd = intermediateTuples.last().second;
             float secondStart = i->first;
             float secondEnd = i->second;
             if (secondStart <= firstEnd && secondEnd <= firstEnd) {
                 // Ignore this range completely
             } else if (secondStart <= firstEnd)
                 firstEnd = secondEnd;
-            else {
+            else
                 intermediateTuples.append(*i);
-                ++lastIntermediate;
-            }
         }
     } else
         intermediateTuples = tuples;