From 380b8039ec31b6e093a044d15750bf5a22be8cd7 Mon Sep 17 00:00:00 2001 From: Ev1lbl0w Date: Sat, 14 Mar 2020 13:08:01 +0000 Subject: Fix divison by zero issue --- scene/resources/audio_stream_sample.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scene/resources') diff --git a/scene/resources/audio_stream_sample.cpp b/scene/resources/audio_stream_sample.cpp index ed25729c40..a68b750b31 100644 --- a/scene/resources/audio_stream_sample.cpp +++ b/scene/resources/audio_stream_sample.cpp @@ -258,7 +258,7 @@ void AudioStreamPlaybackSample::mix(AudioFrame *p_buffer, float p_rate_scale, in float srate = base->mix_rate; srate *= p_rate_scale; float fincrement = srate / base_rate; - int32_t increment = int32_t(fincrement * MIX_FRAC_LEN); + int32_t increment = int32_t(MAX(fincrement * MIX_FRAC_LEN, 1)); increment *= sign; //looping -- cgit v1.2.3