Guard the voice stealing iif voices are empty

This commit is contained in:
Paul Ferrand 2020-08-10 17:10:19 +02:00
parent 2cdf4f165f
commit f318c528a2

View file

@ -7,6 +7,9 @@ sfz::VoiceStealing::VoiceStealing()
sfz::Voice* sfz::VoiceStealing::steal(absl::Span<sfz::Voice*> voices) noexcept
{
if (voices.empty())
return {};
// Start of the voice stealing algorithm
absl::c_stable_sort(voices, voiceOrdering);