Add a size check on the smoother iteration

This commit is contained in:
Jean Pierre Cimalando 2020-06-21 15:44:59 +02:00
parent 3b5f215a10
commit d818b0d7c8

View file

@ -392,9 +392,11 @@ private:
template <class F>
void forEachWithSmoother(sfz::Mod modId, F&& lambda)
{
size_t count = region->modifiers[modId].size();
ASSERT(count == modifierSmoothers[modId].size());
auto mod = region->modifiers[modId].begin();
auto smoother = modifierSmoothers[modId].begin();
while (mod < region->modifiers[modId].end()) {
for (size_t i = 0; i < count; ++i) {
lambda(*mod, *smoother);
incrementAll(mod, smoother);
}