diff options
author | Jim Van Verth <jvanverth@google.com> | 2018-05-31 13:15:16 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-06-01 14:02:46 +0000 |
commit | 1989c4995c9a5c6441e80a95de289bc870aabedb (patch) | |
tree | ff7161fda5248f7aa95ba43ebc0e86af0265c17c /src/utils/SkShadowTessellator.cpp | |
parent | 911ae4066eb79f9a95a2d81e02d12c005b2db066 (diff) |
Avoid divide-by-zero in shadow code
Bug: oss-fuzz:6728
Change-Id: Id87140c8ee3b4e438c0c1e7d9b108a40e2a65fbe
Reviewed-on: https://skia-review.googlesource.com/131145
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Diffstat (limited to 'src/utils/SkShadowTessellator.cpp')
-rwxr-xr-x | src/utils/SkShadowTessellator.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/utils/SkShadowTessellator.cpp b/src/utils/SkShadowTessellator.cpp index c377579de2..c07311c43d 100755 --- a/src/utils/SkShadowTessellator.cpp +++ b/src/utils/SkShadowTessellator.cpp @@ -1587,7 +1587,8 @@ sk_sp<SkVertices> SkShadowTessellator::MakeSpot(const SkPath& path, const SkMatr const SkPoint3& zPlane, const SkPoint3& lightPos, SkScalar lightRadius, bool transparent) { if (!ctm.mapRect(path.getBounds()).isFinite() || !zPlane.isFinite() || - !lightPos.isFinite() || !SkScalarIsFinite(lightRadius) || !(lightRadius > 0)) { + !lightPos.isFinite() || !(lightPos.fZ >= SK_ScalarNearlyZero) || + !SkScalarIsFinite(lightRadius) || !(lightRadius >= SK_ScalarNearlyZero)) { return nullptr; } SkSpotShadowTessellator spotTess(path, ctm, zPlane, lightPos, lightRadius, transparent); |