Index: src/effects/gradients/SkLinearGradient.cpp |
diff --git a/src/effects/gradients/SkLinearGradient.cpp b/src/effects/gradients/SkLinearGradient.cpp |
index b34c7964ee4770e23c44f92aafcd2295fdff784c..c7d845a1885b74b17323f1c8578612407ea3752e 100644 |
--- a/src/effects/gradients/SkLinearGradient.cpp |
+++ b/src/effects/gradients/SkLinearGradient.cpp |
@@ -149,6 +149,7 @@ void shadeSpan_linear_clamp(TileProc proc, SkGradFixed dx, SkGradFixed fx, |
int toggle, int count) { |
SkClampRange range; |
range.init(fx, dx, count, 0, SkGradientShaderBase::kCache32Count - 1); |
+ range.validate(count); |
if ((count = range.fCount0) > 0) { |
sk_memset32_dither(dstC, |
@@ -332,6 +333,7 @@ void shadeSpan16_linear_clamp(TileProc proc, SkGradFixed dx, SkGradFixed fx, |
int toggle, int count) { |
SkClampRange range; |
range.init(fx, dx, count, 0, SkGradientShaderBase::kCache32Count - 1); |
+ range.validate(count); |
if ((count = range.fCount0) > 0) { |
dither_memset16(dstC, |