Auto merge of #14605 - emilio:crashtest-bug-1323717, r=SimonSapin

style: Avoid ending up with an invalid keyframe when inf or NaN are a…

<!-- Please describe your changes on the following line: -->

Fixes: https://bugzilla.mozilla.org/show_bug.cgi?id=1323717

r? @SimonSapin

<!-- 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/14605)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-12-15 17:45:12 -08:00 committed by GitHub
commit da42fea6b2
3 changed files with 24 additions and 2 deletions

View file

@ -50,10 +50,11 @@ impl KeyframePercentage {
KeyframePercentage::new(1.)
} else {
let percentage = try!(input.expect_percentage());
if percentage > 1. || percentage < 0. {
if percentage >= 0. && percentage <= 1. {
KeyframePercentage::new(percentage)
} else {
return Err(());
}
KeyframePercentage::new(percentage)
};
Ok(percentage)