Skip non-finite vertices in GrTriangulator There isn't a correct way to draw these, and receiving them is a bug from the higher level. Just throw them away so we don't crash, and accept that the draw results will look funny. Fixes #7235 Diffs= 17f604311 Skip non-finite vertices in GrTriangulator (#7239) Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
diff --git a/.rive_head b/.rive_head index 16595e9..f350668 100644 --- a/.rive_head +++ b/.rive_head
@@ -1 +1 @@ -c83e2f1bcaa345aa04f719271cab63dfed3466ba +17f604311327e786f48dfdfca37501f10dfd5c6c
diff --git a/renderer/gr_triangulator.cpp b/renderer/gr_triangulator.cpp index d282d2f..fe995bf 100644 --- a/renderer/gr_triangulator.cpp +++ b/renderer/gr_triangulator.cpp
@@ -742,11 +742,17 @@ { contour++; } - this->appendPointToContour(pts[0], contour); + if (is_finite(pts[0])) + { + this->appendPointToContour(pts[0], contour); + } break; case PathVerb::line: { - this->appendPointToContour(pts[1], contour); + if (is_finite(pts[1])) + { + this->appendPointToContour(pts[1], contour); + } break; } case PathVerb::quad: @@ -1665,7 +1671,11 @@ { for (VertexList* contour = contours; contourCnt > 0; --contourCnt, ++contour) { - assert(contour->fHead); + if (contour->fHead == nullptr) + { + continue; // empty + } + Vertex* prev = contour->fTail; prev->fPoint.x = double_to_clamped_scalar((double)prev->fPoint.x); prev->fPoint.y = double_to_clamped_scalar((double)prev->fPoint.y);