Fix multiplication of maxIterations in PolyUtils

Bug: oss-fuzz:11546
Change-Id: Icb08cfeb685d3992d99df8f98336093a79295ed0
Reviewed-on: https://skia-review.googlesource.com/c/172869
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
This commit is contained in:
Kevin Lubick 2018-11-26 13:01:10 -05:00 committed by Skia Commit-Bot
parent 037ea382aa
commit bfd90e3902

View File

@ -1262,7 +1262,7 @@ bool SkOffsetSimplePolygon(const SkPoint* inputPolygonVerts, int inputPolygonSiz
auto currEdge = head;
unsigned int offsetVertexCount = numEdges;
unsigned long long iterations = 0;
unsigned long long maxIterations = (unsigned long long)(numEdges*numEdges);
unsigned long long maxIterations = (unsigned long long)(numEdges) * numEdges;
while (head && prevEdge != currEdge && offsetVertexCount > 0) {
++iterations;
// we should check each edge against each other edge at most once