- add extra check whether the keyframes are well-ordered.

pull/14/head
Alexander Gessler 2012-07-22 01:23:23 +02:00
parent 5ff8c90a35
commit 29057096fd
2 changed files with 5 additions and 2 deletions

View File

@ -72,7 +72,11 @@ AnimationCurve::AnimationCurve(uint64_t id, const Element& element, const std::s
if(keys.size() != values.size()) {
DOMError("the number of key times does not match the number of keyframe values",&KeyTime);
}
// check if the key times are well-ordered
if(!std::equal(keys.begin(), keys.end() - 1, keys.begin() + 1, std::less<KeyTimeList::value_type>())) {
DOMError("the keyframes are not in ascending order",&KeyTime);
}
const Element* KeyAttrDataFloat = sc["KeyAttrDataFloat"];
if(KeyAttrDataFloat) {

View File

@ -1052,7 +1052,6 @@ private:
// ------------------------------------------------------------------------------------------------
KeyFrameListList GetKeyframeList(const std::vector<const AnimationCurveNode*>& nodes)
{