check for non-finite values in point3 case

Bug: oss-fuzz:20581
Bug: 1050296
Change-Id: I3059bc95fc9f54d1cb2f228101065b03167762a0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/270636
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Mike Reed <reed@google.com>
This commit is contained in:
Mike Reed 2020-02-13 09:38:05 -05:00 committed by Skia Commit-Bot
parent 3bf3b92dfa
commit 7c81245a18

View File

@ -333,6 +333,10 @@ void SkDraw::drawVertices(SkVertices::VertexMode vmode, int vertexCount,
if (usePerspective) {
dev3 = outerAlloc.makeArray<SkPoint3>(vertexCount);
fMatrix->mapHomogeneousPoints(dev3, vertices, vertexCount);
// similar to the bounds check for 2d points (below)
if (!SkScalarsAreFinite((const SkScalar*)dev3, vertexCount * 3)) {
return;
}
} else {
devVerts = outerAlloc.makeArray<SkPoint>(vertexCount);
fMatrix->mapPoints(devVerts, vertices, vertexCount);