commit | b456e2fc84b1bbb7209904c0835f671a59663ac9 | [log] [tgz] |
---|---|---|
author | Robert Phillips <robertphillips@google.com> | Mon Jul 09 15:06:32 2018 -0400 |
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | Mon Jul 09 21:01:08 2018 +0000 |
tree | bf9185c565924463e46f940841e168bcadcd6665 | |
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>
diff --git a/src/shaders/gradients/SkGradientShader.cpp b/src/shaders/gradients/SkGradientShader.cpp index 1cbad4a..ff22cc5 100644 --- a/src/shaders/gradients/SkGradientShader.cpp +++ b/src/shaders/gradients/SkGradientShader.cpp
@@ -879,7 +879,7 @@ 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)) {