Check for legit bounds in SkTriangulateSimplePolygon
Bug: skia:8467, oss-fuzz:10929
Change-Id: I6336e00004322960319e3076677029d3b17c78e3
Reviewed-on: https://skia-review.googlesource.com/c/162028
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Auto-Submit: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
diff --git a/src/utils/SkPolyUtils.cpp b/src/utils/SkPolyUtils.cpp
index 1d8bec0..eb19e59 100644
--- a/src/utils/SkPolyUtils.cpp
+++ b/src/utils/SkPolyUtils.cpp
@@ -1538,7 +1538,9 @@
// get bounds
SkRect bounds;
- bounds.setBounds(polygonVerts, polygonSize);
+ if (!bounds.setBoundsCheck(polygonVerts, polygonSize)) {
+ return false;
+ }
// get winding direction
// TODO: we do this for all the polygon routines -- might be better to have the client
// compute it and pass it in