Index: src/core/SkBitmapScaler.cpp |
diff --git a/src/core/SkBitmapScaler.cpp b/src/core/SkBitmapScaler.cpp |
index c69ac2a950b7ca736b834a8330c8bb2e2131cbfb..e3face8c750d3676c013d20c0392a4eaa7cacb93 100644 |
--- a/src/core/SkBitmapScaler.cpp |
+++ b/src/core/SkBitmapScaler.cpp |
@@ -167,7 +167,10 @@ void SkResizeFilter::computeFilters(int srcSize, |
// is at (2.5, 2.5). |
float destFilterDist = (srcBegin + 0.5f - srcPixel) * clampedScale; |
int filterCount = SkScalarTruncToInt(srcEnd - srcBegin) + 1; |
- SkASSERT(filterCount > 0); |
+ if (filterCount <= 0) { |
+ // true when srcSize is equal to srcPixel - srcSupport; this may be a bug |
+ return; |
+ } |
filterValuesArray.reset(filterCount); |
float filterSum = fBitmapFilter->evaluate_n(destFilterDist, clampedScale, filterCount, |
filterValuesArray.begin()); |