guard against NaN in path is rect
Recent rewrite of SkPath::isRect() did not check against
sequences with NaN and infinity.
R=kjlubick@google.com
Bug: oss-fuzz:7882
Change-Id: I9315f68e4c53c37fda819adc6d57d6b3e3acc1c6
Reviewed-on: https://skia-review.googlesource.com/122783
Commit-Queue: Cary Clark <caryclark@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Auto-Submit: Cary Clark <caryclark@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp
index 0683c17..54d7a69 100644
--- a/src/core/SkPath.cpp
+++ b/src/core/SkPath.cpp
@@ -480,6 +480,9 @@
if (lineDelta.fX && lineDelta.fY) {
return false; // diagonal
}
+ if (!lineDelta.isFinite()) {
+ return false; // path contains infinity or NaN
+ }
if (lineStart == lineEnd) {
break; // single point on side OK
}