Merge pull request #37046 from Ev1lbl0w/fork/bugfix

Fix divison by zero issue in audio
This commit is contained in:
Rémi Verschelde 2020-03-14 14:38:53 +01:00 committed by GitHub
commit 3d2bae9a7d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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