On windows debug builds, was getting a "Debug Assertion Failed" on
simplify.cpp, line 379. This is because this we were using iterators
that have become invalid because the underlying data was altered.
TsKeyFrame kCopy = *k;
TsKeyFrame k0Copy;
+ bool k0CopyValid = false;
TsKeyFrame k1Copy;
+ bool k1CopyValid = false;
if (k0 != spline->end()) {
k0Copy = *k0;
+ k0CopyValid = true;
}
if (k1 != spline->end()) {
k1Copy = *k1;
+ k1CopyValid = true;
}
spline->RemoveKeyFrame(kCopy.GetTime());
spline->SetKeyFrame( kCopy);
// We may have set these in _SimplifySpan, so we want to set them back to
// what they were before.
- if (k0 != spline->end()) {
+ if (k0CopyValid) {
spline->SetKeyFrame(k0Copy);
}
- if (k1 != spline->end()) {
+ if (k1CopyValid) {
spline->SetKeyFrame(k1Copy);
}