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>
This commit is contained in:
Cary Clark 2018-04-20 10:14:41 -04:00 committed by Skia Commit-Bot
parent 8f88d89796
commit 1eece78318

View File

@ -480,6 +480,9 @@ bool SkPath::isRectContour(bool allowPartial, int* currVerb, const SkPoint** pts
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
}