Protect against div-by-zero in GrSmallPathRenderer::onCanDrawPath
Bug: oss-fuzz:33865
Change-Id: I769e28ace7a61a5a1053777ce8270365975620c5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/433136
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
diff --git a/src/gpu/ops/GrSmallPathRenderer.cpp b/src/gpu/ops/GrSmallPathRenderer.cpp
index 8bf06cd..295cbc27 100644
--- a/src/gpu/ops/GrSmallPathRenderer.cpp
+++ b/src/gpu/ops/GrSmallPathRenderer.cpp
@@ -72,7 +72,7 @@
return CanDrawPath::kNo;
}
// For affine transformations, too much shear can produce artifacts.
- if (scaleFactors[1]/scaleFactors[0] > 4) {
+ if (!scaleFactors[0] || scaleFactors[1]/scaleFactors[0] > 4) {
return CanDrawPath::kNo;
}
// Only support paths with bounds within kMaxDim by kMaxDim,