Index: src/core/SkAnalyticEdge.cpp |
diff --git a/src/core/SkAnalyticEdge.cpp b/src/core/SkAnalyticEdge.cpp |
index fde37e09db76014789c67cc3e9b7279847ee67f3..c17426d1db50e31668820ccebc2fc889dd112de1 100644 |
--- a/src/core/SkAnalyticEdge.cpp |
+++ b/src/core/SkAnalyticEdge.cpp |
@@ -22,8 +22,11 @@ public: |
}; |
static inline SkFixed quickSkFDot6Div(SkFDot6 a, SkFDot6 b) { |
- if (SkAbs32(b) < kInverseTableSize) { |
- SkASSERT((int64_t)a * QuickFDot6Inverse::Lookup(b) <= SK_MaxS32); |
+ // Max inverse of b is 2^6 which is 2^22 in SkFixed format. |
+ // Hence the safe value of abs(a) should be less than 2^10. |
+ if (SkAbs32(b) < kInverseTableSize && SkAbs32(a) < (1 << 10)) { |
+ SkASSERT((int64_t)a * QuickFDot6Inverse::Lookup(b) <= SK_MaxS32 |
+ && (int64_t)a * QuickFDot6Inverse::Lookup(b) >= SK_MinS32); |
SkFixed ourAnswer = (a * QuickFDot6Inverse::Lookup(b)) >> 6; |
#ifdef SK_DEBUG |
SkFixed directAnswer = SkFDot6Div(a, b); |