Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(490)

Unified Diff: src/core/SkPathRef.cpp

Issue 801003003: Harden validation for SkPathRef (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPathRef.cpp
diff --git a/src/core/SkPathRef.cpp b/src/core/SkPathRef.cpp
index aed6cdaee74b5bef155de6a5f33a73be226fe592..e7b70b9285bd9533f07d9a59f93874353d236cba 100644
--- a/src/core/SkPathRef.cpp
+++ b/src/core/SkPathRef.cpp
@@ -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;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698