From 81afc04b5368fc4a7cb6ae4b4d7069e67a3a51f8 Mon Sep 17 00:00:00 2001 From: Mike Reed Date: Wed, 2 May 2018 13:15:06 -0400 Subject: check for finite vertices Bug: oss-fuzz:6115 Change-Id: Ib971304141322cfcf62ed079ef10c2910a9e2bf1 Reviewed-on: https://skia-review.googlesource.com/125343 Reviewed-by: Florin Malita Commit-Queue: Mike Reed --- src/core/SkDraw_vertices.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') 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(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); -- cgit v1.2.3