Merge pull request #27 from besmaller/bugfix/#25-segfault
Bug fix for segfault in fixStaticSegmentRules
This commit is contained in:
commit
04595a0441
|
@ -141,7 +141,11 @@ ContinuousTimeline<ShapeRule> fixStaticSegmentRules(const ContinuousTimeline<Sha
|
||||||
|
|
||||||
// Find best solution. Start with a single replacement, then increase as necessary.
|
// Find best solution. Start with a single replacement, then increase as necessary.
|
||||||
RuleChangeScenario bestScenario(shapeRules, {}, animate);
|
RuleChangeScenario bestScenario(shapeRules, {}, animate);
|
||||||
for (int replacementCount = 1; bestScenario.getStaticSegmentCount() > 0 && replacementCount <= maxReplacementCount; ++replacementCount) {
|
for (
|
||||||
|
int replacementCount = 1;
|
||||||
|
bestScenario.getStaticSegmentCount() > 0 && replacementCount <= std::min(static_cast<int>(possibleRuleChanges.size()), maxReplacementCount);
|
||||||
|
++replacementCount
|
||||||
|
) {
|
||||||
// Only the first <replacementCount> elements of `currentRuleChanges` count
|
// Only the first <replacementCount> elements of `currentRuleChanges` count
|
||||||
auto currentRuleChanges(possibleRuleChanges);
|
auto currentRuleChanges(possibleRuleChanges);
|
||||||
do {
|
do {
|
||||||
|
|
Loading…
Reference in New Issue