Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(479)

Unified Diff: src/effects/gradients/SkGradientShader.cpp

Issue 1974463002: Harden linear gradients (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: remove unneeded 1-color veto Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/effects/gradients/SkLinearGradient.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | src/effects/gradients/SkLinearGradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698