Fixes an issue where a lone instant keyframe at the end of the animation
would produce bad values as the iterator tries to divide by zero.
if(realloc)
{
for(unsigned i=1; i<keyframes.size(); ++i)
- keyframes[i].prev = &keyframes[i-1];
+ if(keyframes[i].prev)
+ keyframes[i].prev = &keyframes[i-1];
}
- else if(keyframes.size()>1)
+ if(keyframes.size()>1 && t>(&tkf-1)->time)
tkf.prev = &tkf-1;
prepare_keyframe(tkf);