Clamping submix effect chain entry index in Audio Mixer Blueprint Library

#jria UE-165936, UE-165938
#rb ryan.mangin, phil.popp
#preflight 633f3026607039cbc11855b5

[CL 22462682 by maxwell hayes in ue5-main branch]
This commit is contained in:
maxwell hayes
2022-10-11 14:52:38 -04:00
parent 521a10d411
commit b98f2cfc4f

View File

@@ -536,12 +536,11 @@ void UAudioMixerBlueprintLibrary::RemoveSourceEffectFromPresetChain(const UObjec
Chain = PresetChain->Chain;
}
if (EntryIndex < Chain.Num())
if (EntryIndex >= 0 && EntryIndex < Chain.Num())
{
Chain.RemoveAt(EntryIndex);
MixerDevice->UpdateSourceEffectChain(PresetChainId, Chain, PresetChain->bPlayEffectChainTails);
}
MixerDevice->UpdateSourceEffectChain(PresetChainId, Chain, PresetChain->bPlayEffectChainTails);
}
}
@@ -565,12 +564,11 @@ void UAudioMixerBlueprintLibrary::SetBypassSourceEffectChainEntry(const UObject*
Chain = PresetChain->Chain;
}
if (EntryIndex < Chain.Num())
if (EntryIndex >= 0 && EntryIndex < Chain.Num())
{
Chain[EntryIndex].bBypass = bBypassed;
MixerDevice->UpdateSourceEffectChain(PresetChainId, Chain, PresetChain->bPlayEffectChainTails);
}
MixerDevice->UpdateSourceEffectChain(PresetChainId, Chain, PresetChain->bPlayEffectChainTails);
}
}