Add some checks to GrDashOp
Bug: oss-fuzz:9322 Change-Id: I9d40e85814138fd83efa497e00c0d612cc26043e Reviewed-on: https://skia-review.googlesource.com/158821 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
This commit is contained in:
parent
81c8a20112
commit
f86073a131
@ -1590,6 +1590,10 @@ void GrRenderTargetContext::drawShapeUsingPathRenderer(const GrClip& clip,
|
||||
RETURN_IF_ABANDONED
|
||||
GR_CREATE_TRACE_MARKER_CONTEXT("GrRenderTargetContext", "internalDrawPath", fContext);
|
||||
|
||||
if (!viewMatrix.isFinite() || !originalShape.bounds().isFinite()) {
|
||||
return;
|
||||
}
|
||||
|
||||
SkIRect clipConservativeBounds;
|
||||
clip.getConservativeBounds(this->width(), this->height(), &clipConservativeBounds, nullptr);
|
||||
|
||||
|
@ -793,6 +793,10 @@ std::unique_ptr<GrDrawOp> GrDashOp::MakeDashLineOp(GrContext* context,
|
||||
// Scale corrections of intervals and stroke from view matrix
|
||||
calc_dash_scaling(&lineData.fParallelScale, &lineData.fPerpendicularScale, viewMatrix,
|
||||
lineData.fPtsRot);
|
||||
if (SkScalarNearlyZero(lineData.fParallelScale) ||
|
||||
SkScalarNearlyZero(lineData.fPerpendicularScale)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
SkScalar offInterval = intervals[1] * lineData.fParallelScale;
|
||||
SkScalar strokeWidth = lineData.fSrcStrokeWidth * lineData.fPerpendicularScale;
|
||||
|
Loading…
Reference in New Issue
Block a user