diff options
author | Manish Goregaokar <manishsmail@gmail.com> | 2017-01-31 22:23:00 -0800 |
---|---|---|
committer | Manish Goregaokar <manishsmail@gmail.com> | 2017-01-31 22:23:00 -0800 |
commit | c0e1a1f9631276b807f302637f096af42575ca28 (patch) | |
tree | 0547a02678b6d9af3804eeedbe2546e8f5cc8689 | |
parent | da89099e26955cf5ba44031a0a536e3af4e6a0d5 (diff) | |
download | servo-c0e1a1f9631276b807f302637f096af42575ca28.tar.gz servo-c0e1a1f9631276b807f302637f096af42575ca28.zip |
Ensure that gradients have at least 2 stops
-rw-r--r-- | components/style/values/specified/image.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/components/style/values/specified/image.rs b/components/style/values/specified/image.rs index 3709ad20619..f63c1ae0ec3 100644 --- a/components/style/values/specified/image.rs +++ b/components/style/values/specified/image.rs @@ -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, |