aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2018-05-02 13:15:06 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-05-02 18:33:10 +0000
commit81afc04b5368fc4a7cb6ae4b4d7069e67a3a51f8 (patch)
tree24114df6914da494160276b2a962d95329490ada
parent521af9b3b22ac8292c9e24e3b4cd546eccd20982 (diff)
check for finite vertices
Bug: oss-fuzz:6115 Change-Id: Ib971304141322cfcf62ed079ef10c2910a9e2bf1 Reviewed-on: https://skia-review.googlesource.com/125343 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
-rw-r--r--src/core/SkDraw_vertices.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core/SkDraw_vertices.cpp b/src/core/SkDraw_vertices.cpp
index 8c1ad1f007..000be07cea 100644
--- a/src/core/SkDraw_vertices.cpp
+++ b/src/core/SkDraw_vertices.cpp
@@ -223,6 +223,15 @@ void SkDraw::drawVertices(SkVertices::VertexMode vmode, int count,
SkPoint* devVerts = outerAlloc.makeArray<SkPoint>(count);
fMatrix->mapPoints(devVerts, vertices, count);
+ {
+ SkRect bounds;
+ // this also sets bounds to empty if we see a non-finite value
+ bounds.set(devVerts, count);
+ if (bounds.isEmpty()) {
+ return;
+ }
+ }
+
VertState state(count, indices, indexCount);
VertState::Proc vertProc = state.chooseProc(vmode);