aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@chromium.org>2015-02-24 12:58:46 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-02-24 12:58:46 -0800
commit5b27b142f28d9c91ac38211ea611ba26259e1f85 (patch)
treeec47261a473efeb8245c8632632af3d38dfa0c0b /src
parent334fcbc167237f02058cb508cb5f51b718141461 (diff)
don't draw if maxVertices returns 0 or > than uin16_t max
This doesn't do anything about the issue of having too many indices, but it does move the fuzzer on to another assert. BUG=skia: Review URL: https://codereview.chromium.org/952993004
Diffstat (limited to 'src')
-rw-r--r--src/gpu/GrDefaultPathRenderer.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gpu/GrDefaultPathRenderer.cpp b/src/gpu/GrDefaultPathRenderer.cpp
index e4f54ccd61..131b518296 100644
--- a/src/gpu/GrDefaultPathRenderer.cpp
+++ b/src/gpu/GrDefaultPathRenderer.cpp
@@ -290,6 +290,11 @@ public:
isIndexed = isIndexed || contourCount > 1;
}
+ if (maxVertices == 0 || maxVertices > ((int)SK_MaxU16 + 1)) {
+ SkDebugf("Cannot render path (%d)\n", maxVertices);
+ return;
+ }
+
// determine primitiveType
int maxIndices = 0;
GrPrimitiveType primitiveType;