Harden validation for SkPathRef

Review URL: https://codereview.chromium.org/801003003
This commit is contained in:
robertphillips 2014-12-12 12:47:59 -08:00 committed by Commit bot
parent 24da24dfad
commit 0e912464ce

View File

@ -452,11 +452,9 @@ void SkPathRef::validate() const {
if (!fBoundsIsDirty && !fBounds.isEmpty()) { if (!fBoundsIsDirty && !fBounds.isEmpty()) {
bool isFinite = true; bool isFinite = true;
for (int i = 0; i < fPointCnt; ++i) { for (int i = 0; i < fPointCnt; ++i) {
SkASSERT(!fPoints[i].isFinite() || ( SkASSERT(!fPoints[i].isFinite() ||
fBounds.fLeft - fPoints[i].fX < SK_ScalarNearlyZero && (fPoints[i].fX >= fBounds.fLeft && fPoints[i].fX <= fBounds.fRight &&
fPoints[i].fX - fBounds.fRight < SK_ScalarNearlyZero && fPoints[i].fY >= fBounds.fTop && fPoints[i].fY <= fBounds.fBottom));
fBounds.fTop - fPoints[i].fY < SK_ScalarNearlyZero &&
fPoints[i].fY - fBounds.fBottom < SK_ScalarNearlyZero));
if (!fPoints[i].isFinite()) { if (!fPoints[i].isFinite()) {
isFinite = false; isFinite = false;
} }