Index: src/core/SkMatrix.cpp |
diff --git a/src/core/SkMatrix.cpp b/src/core/SkMatrix.cpp |
index 67ae052e06d0197175dd2ad3d4be48b9df1e6ed0..dfeb721d45e68394f4bf2db1906c11d708f044e3 100644 |
--- a/src/core/SkMatrix.cpp |
+++ b/src/core/SkMatrix.cpp |
@@ -1488,9 +1488,15 @@ template <MinMaxOrBoth MIN_MAX_OR_BOTH> bool get_scale_factor(SkMatrix::TypeMask |
results[1] = apluscdiv2 + x; |
} |
} |
+ if (SkScalarIsNaN(results[0])) { |
+ return false; |
+ } |
SkASSERT(results[0] >= 0); |
results[0] = SkScalarSqrt(results[0]); |
if (kBoth_MinMaxOrBoth == MIN_MAX_OR_BOTH) { |
+ if (SkScalarIsNaN(results[1])) { |
+ return false; |
+ } |
SkASSERT(results[1] >= 0); |
results[1] = SkScalarSqrt(results[1]); |
} |