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

OouraFft::fft smashes heap if N is not a power of 2 #35

Open
dspeyer opened this issue Jul 25, 2014 · 3 comments
Open

OouraFft::fft smashes heap if N is not a power of 2 #35

dspeyer opened this issue Jul 25, 2014 · 3 comments

Comments

@dspeyer
Copy link

dspeyer commented Jul 25, 2014

The underlying fft4g library requires (but does not check for) the input size to be a power of 2. If you invoke OouraFft::OouraFft with a parameter that is not a power of 2, it will seem to work, but the first call to OouraFft::fft will write to unallocated memory. This may or may not cause SIGSEGV later in the program (how I discovered it) but it can always be detected with Valgrind.

A simple assert in the constructor would have saved me much time and aggravation. An addition to the documentation of the constructor and more importantly FftFactory::getFft would also be a good idea. Actual support for unevenly sized input data would be nice.

@zsiciarz
Copy link
Owner

Yeah, sorry that wasn't documented anywhere :( I know this case and at some point made the decision to skip support FFT's of sizes different that powers of 2 until some later release. I'll try to update the doc comments soon. Thanks for noticing the problem!

@hellocodeM
Copy link

It costed me several hours until I encountered this issues, thanks god!

@clarkli86
Copy link

It has been mentioned in the fft interface, but not for mfcc
http://aquila-dsp.org/site_media/doc/html/class_aquila_1_1_mfcc.html

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

No branches or pull requests

4 participants