diff options
author | Robert Phillips <robertphillips@google.com> | 2018-07-09 15:06:32 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-07-09 21:01:08 +0000 |
commit | b456e2fc84b1bbb7209904c0835f671a59663ac9 (patch) | |
tree | bf9185c565924463e46f940841e168bcadcd6665 /src | |
parent | 9a6e42ff18133ef77066b82cb7e2d19788edd968 (diff) |
Fix fuzzer bug in SkGradientShader::MakeSweep
In this case, startAngle was NaN while endAngle was -NaN
Change-Id: Ic3498a6f08700437590eb219e2baf535db912cc2
Reviewed-on: https://skia-review.googlesource.com/139980
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/shaders/gradients/SkGradientShader.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/shaders/gradients/SkGradientShader.cpp b/src/shaders/gradients/SkGradientShader.cpp index 1cbad4ac11..ff22cc598a 100644 --- a/src/shaders/gradients/SkGradientShader.cpp +++ b/src/shaders/gradients/SkGradientShader.cpp @@ -879,7 +879,7 @@ sk_sp<SkShader> SkGradientShader::MakeSweep(SkScalar cx, SkScalar cy, if (1 == colorCount) { return SkShader::MakeColorShader(colors[0], std::move(colorSpace)); } - if (startAngle >= endAngle) { + if (!SkScalarIsFinite(startAngle) || !SkScalarIsFinite(endAngle) || startAngle >= endAngle) { return nullptr; } if (localMatrix && !localMatrix->invert(nullptr)) { |