Auto merge of #15323 - Manishearth:gradient-stop, r=heycam

Ensure that gradients have at least 2 stops

fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1335656

r? @heycam

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15323)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-02-01 11:17:13 -08:00 committed by GitHub
commit b7887a1980

View file

@ -141,6 +141,11 @@ impl Gradient {
_ => { return Err(()); }
};
// https://drafts.csswg.org/css-images/#typedef-color-stop-list
if stops.len() < 2 {
return Err(())
}
Ok(Gradient {
stops: stops,
repeating: repeating,