Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Division with 0 in BandLimitedWave.h #6487

Closed
zonkmachine opened this issue Aug 16, 2022 · 2 comments · Fixed by #7021
Closed

Division with 0 in BandLimitedWave.h #6487

zonkmachine opened this issue Aug 16, 2022 · 2 comments · Fixed by #7021
Labels

Comments

@zonkmachine
Copy link
Member

Division with 0 in BandLimitedWave.h

static inline float pdToLen( float pd )
{
return 1.0f / pd;
}

It seem to be used only in LB302 and Monstro which will crash in fpe enabled debugging.
So, std::max() with some suitable small number.

The function above, freqToLen() is also potentially dividing with 0 but doesn't seem to be used anywhere.

static inline float freqToLen( float f, sample_rate_t sr )
{
return static_cast<float>( sr ) / f;
}

@luzpaz

This comment was marked as off-topic.

@zonkmachine

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants