aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Jim Van Verth <jvanverth@google.com>2018-02-07 15:02:50 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-02-08 14:34:49 +0000
commit7c8008c0bd02e74ab60971ca9f6b37d82f110e56 (patch)
tree552bc2445b2392efb81634d3705eada7218e2a9c /src
parent0b33cc42b480f06dc0c41805823e29c27b8d6813 (diff)
Check for valid z-transform function in shadow generation
Bug: oss-fuzz:5630 Change-Id: I608a8a2db608396932eb732b8d7b61ab9fbcc322 Reviewed-on: https://skia-review.googlesource.com/105223 Reviewed-by: Kevin Lubick <kjlubick@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
Diffstat (limited to 'src')
-rwxr-xr-xsrc/utils/SkShadowTessellator.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/utils/SkShadowTessellator.cpp b/src/utils/SkShadowTessellator.cpp
index 1a714076e7..11e8f2d5c6 100755
--- a/src/utils/SkShadowTessellator.cpp
+++ b/src/utils/SkShadowTessellator.cpp
@@ -384,7 +384,9 @@ SkAmbientShadowTessellator::SkAmbientShadowTessellator(const SkPath& path,
// make sure we're not below the canvas plane
this->setZOffset(path.getBounds(), ctm.hasPerspective());
- this->setTransformedHeightFunc(ctm);
+ if (!this->setTransformedHeightFunc(ctm)) {
+ return;
+ }
// Outer ring: 3*numPts
// Middle ring: numPts
@@ -828,7 +830,9 @@ SkSpotShadowTessellator::SkSpotShadowTessellator(const SkPath& path, const SkMat
SkMatrix fullTransform = SkMatrix::Concat(shadowTransform, ctm);
// Set up our reverse mapping
- this->setTransformedHeightFunc(fullTransform);
+ if (!this->setTransformedHeightFunc(fullTransform)) {
+ return;
+ }
// TODO: calculate these reserves better
// Penumbra ring: 3*numPts