Index: src/effects/gradients/SkGradientShader.cpp |
diff --git a/src/effects/gradients/SkGradientShader.cpp b/src/effects/gradients/SkGradientShader.cpp |
index fdb6e59e1ca56e52a1450e1400bb07ce0286930a..3c4784702ab36cadf12544fd6fe961864b5fe9b0 100644 |
--- a/src/effects/gradients/SkGradientShader.cpp |
+++ b/src/effects/gradients/SkGradientShader.cpp |
@@ -774,6 +774,8 @@ static bool valid_grad(const SkColor colors[], const SkScalar pos[], int count, |
static void desc_init(SkGradientShaderBase::Descriptor* desc, |
const SkColor colors[], const SkScalar pos[], int colorCount, |
SkShader::TileMode mode, uint32_t flags, const SkMatrix* localMatrix) { |
+ SkASSERT(colorCount > 1); |
+ |
desc->fColors = colors; |
desc->fPos = pos; |
desc->fCount = colorCount; |