Harden validation for SkPathRef
Review URL: https://codereview.chromium.org/801003003
This commit is contained in:
parent
24da24dfad
commit
0e912464ce
@ -452,11 +452,9 @@ void SkPathRef::validate() const {
|
||||
if (!fBoundsIsDirty && !fBounds.isEmpty()) {
|
||||
bool isFinite = true;
|
||||
for (int i = 0; i < fPointCnt; ++i) {
|
||||
SkASSERT(!fPoints[i].isFinite() || (
|
||||
fBounds.fLeft - fPoints[i].fX < SK_ScalarNearlyZero &&
|
||||
fPoints[i].fX - fBounds.fRight < SK_ScalarNearlyZero &&
|
||||
fBounds.fTop - fPoints[i].fY < SK_ScalarNearlyZero &&
|
||||
fPoints[i].fY - fBounds.fBottom < SK_ScalarNearlyZero));
|
||||
SkASSERT(!fPoints[i].isFinite() ||
|
||||
(fPoints[i].fX >= fBounds.fLeft && fPoints[i].fX <= fBounds.fRight &&
|
||||
fPoints[i].fY >= fBounds.fTop && fPoints[i].fY <= fBounds.fBottom));
|
||||
if (!fPoints[i].isFinite()) {
|
||||
isFinite = false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user