summaryrefslogtreecommitdiff
path: root/scene/resources
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-03-14 14:38:53 +0100
committerGitHub <noreply@github.com>2020-03-14 14:38:53 +0100
commit3d2bae9a7ddd27c7361eb5879cdeb380c1cdc940 (patch)
treebef44cd346f56ddad5aa3091044c77a0da8eb2be /scene/resources
parent750d7ea359a25aa49a086f7b906951201b1c819e (diff)
parent380b8039ec31b6e093a044d15750bf5a22be8cd7 (diff)
Merge pull request #37046 from Ev1lbl0w/fork/bugfix
Fix divison by zero issue in audio
Diffstat (limited to 'scene/resources')
-rw-r--r--scene/resources/audio_stream_sample.cpp2
1 files changed, 1 insertions, 1 deletions
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