Bug 1286458 - Check infinity before setResScale(). r=lsalzman
authorvincentliu <vliu@mozilla.com>
Thu, 21 Jul 2016 10:39:19 +0800
changeset 305991 c805161da79c471e266e8db70ca4e8b18b697e29
parent 305990 57356e7b5e91412e0e616d47de8649c348214791
child 305992 56faf83bf0c3fa65d671c3334227923d9870eacd
push id20080
push usercbook@mozilla.com
push dateThu, 21 Jul 2016 14:27:27 +0000
treeherderfx-team@f5154aaeaec4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslsalzman
bugs1286458
milestone50.0a1
Bug 1286458 - Check infinity before setResScale(). r=lsalzman --- gfx/skia/skia/src/gpu/GrDrawContext.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
gfx/skia/skia/src/gpu/GrDrawContext.cpp
--- a/gfx/skia/skia/src/gpu/GrDrawContext.cpp
+++ b/gfx/skia/skia/src/gpu/GrDrawContext.cpp
@@ -985,17 +985,22 @@ void GrDrawContext::internalDrawPath(con
 
     if (nullptr == pr) {
         if (!GrPathRenderer::IsStrokeHairlineOrEquivalent(*strokeInfoPtr, viewMatrix, nullptr) &&
             !strokeInfoPtr->isFillStyle()) {
             // It didn't work above, so try again with stroke converted to a fill.
             if (!tmpPath.isValid()) {
                 tmpPath.init();
             }
-            dashlessStrokeInfo.setResScale(SkScalarAbs(viewMatrix.getMaxScale()));
+            SkScalar scale = SkScalarAbs(viewMatrix.getMaxScale());
+            if (!SkScalarIsFinite(scale)) {
+                SkDebugf("View matrix scale is not finite.\n");
+                return;
+            }
+            dashlessStrokeInfo.setResScale(scale);
             if (!dashlessStrokeInfo.applyToPath(tmpPath.get(), *pathPtr)) {
                 return;
             }
             pathPtr = tmpPath.get();
             if (pathPtr->isEmpty()) {
                 return;
             }
             dashlessStrokeInfo.setFillStyle();