|
@@ -1131,8 +1131,10 @@ void AudioServer::start_playback_stream(Ref<AudioStreamPlayback> p_playback, Map
|
|
AudioStreamPlaybackBusDetails *new_bus_details = new AudioStreamPlaybackBusDetails();
|
|
AudioStreamPlaybackBusDetails *new_bus_details = new AudioStreamPlaybackBusDetails();
|
|
int idx = 0;
|
|
int idx = 0;
|
|
for (KeyValue<StringName, Vector<AudioFrame>> pair : p_bus_volumes) {
|
|
for (KeyValue<StringName, Vector<AudioFrame>> pair : p_bus_volumes) {
|
|
- ERR_FAIL_COND(pair.value.size() < channel_count);
|
|
|
|
- ERR_FAIL_COND(pair.value.size() != MAX_CHANNELS_PER_BUS);
|
|
|
|
|
|
+ if (pair.value.size() < channel_count || pair.value.size() != MAX_CHANNELS_PER_BUS) {
|
|
|
|
+ delete new_bus_details;
|
|
|
|
+ ERR_FAIL();
|
|
|
|
+ }
|
|
|
|
|
|
new_bus_details->bus_active[idx] = true;
|
|
new_bus_details->bus_active[idx] = true;
|
|
new_bus_details->bus[idx] = pair.key;
|
|
new_bus_details->bus[idx] = pair.key;
|