aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2015-12-07 09:54:02 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-12-07 09:54:02 -0800
commit1d265ca85f51ea1ba087ca4d0f80b008c256a47d (patch)
tree2d282b047d9fca7e792706c4410128d39b9480fa
parentf65fb658147da97b5010276fe99f15952e6333e3 (diff)
Pin result in SkATan2_255
-rw-r--r--src/effects/gradients/SkSweepGradient.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/effects/gradients/SkSweepGradient.cpp b/src/effects/gradients/SkSweepGradient.cpp
index 24e86d023d..4c5935158d 100644
--- a/src/effects/gradients/SkSweepGradient.cpp
+++ b/src/effects/gradients/SkSweepGradient.cpp
@@ -63,6 +63,9 @@ static unsigned SkATan2_255(float y, float x) {
static const float g255Over2PI = 40.584510488433314f;
float result = sk_float_atan2(y, x);
+ if (!SkScalarIsFinite(result)) {
+ return 0;
+ }
if (result < 0) {
result += 2 * SK_ScalarPI;
}