Fix divison by zero issue

This commit is contained in:
Ev1lbl0w 2020-03-14 13:08:01 +00:00
parent 750d7ea359
commit 380b8039ec
No known key found for this signature in database
GPG Key ID: B383693E3746E58A
1 changed files with 1 additions and 1 deletions

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