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

Unified Diff: third_party/WebKit/Source/core/css/CSSGradientValue.cpp

Issue 2259453003: Fixed DCHECK crash for radial gradients with very large values (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simplified test Created 4 years, 4 months 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
Index: third_party/WebKit/Source/core/css/CSSGradientValue.cpp
diff --git a/third_party/WebKit/Source/core/css/CSSGradientValue.cpp b/third_party/WebKit/Source/core/css/CSSGradientValue.cpp
index 098778139fd5821e766fb34032e65386750974c8..097a78eda3ad77061c13937440a900afa64e1369 100644
--- a/third_party/WebKit/Source/core/css/CSSGradientValue.cpp
+++ b/third_party/WebKit/Source/core/css/CSSGradientValue.cpp
@@ -1159,8 +1159,16 @@ PassRefPtr<Gradient> CSSRadialGradientValue::createGradient(const CSSToLengthCon
}
}
+ if (std::isinf(firstRadius))
+ firstRadius = std::numeric_limits<float>::max();
DCHECK(std::isfinite(firstRadius));
+
+ if (std::isinf(secondRadius.width()))
+ secondRadius.setWidth(std::numeric_limits<float>::max());
DCHECK(std::isfinite(secondRadius.width()));
+
+ if (std::isinf(secondRadius.height()))
+ secondRadius.setHeight(std::numeric_limits<float>::max());
Bugs Nash 2016/08/18 05:53:21 Would it be better to put an infinity adjustment i
sashab 2016/08/18 06:41:34 Oh wow, because of you saying that I changed this
DCHECK(std::isfinite(secondRadius.height()));
bool isDegenerate = !secondRadius.width() || !secondRadius.height();

Powered by Google App Engine
This is Rietveld 408576698