Enforce no-null-args to FFTs; avoid corresponding potential crash in formant preservation code

This commit is contained in:
Chris Cannam
2012-10-28 10:23:42 +00:00
parent 39a311b383
commit 82d1f570da
3 changed files with 63 additions and 3 deletions

View File

@@ -45,17 +45,21 @@ class FFTImpl;
* The "interleaved" functions use the format sometimes called CCS --
* size/2+1 real+imaginary pairs. So, the array elements at indices 1
* and size+1 will always be zero (since the signal is real).
*
* All pointer arguments must point to valid data. A NullArgument
* exception is thrown if any argument is NULL.
*
* Neither forward nor inverse transform is scaled.
*
* This class is reentrant but not thread safe: use a separate
* instance per thread, or use a mutex.
*/
class FFT
{
public:
enum Exception { InvalidSize, InvalidImplementation, InternalError };
enum Exception {
NullArgument, InvalidSize, InvalidImplementation, InternalError
};
FFT(int size, int debugLevel = 0); // may throw InvalidSize
~FFT();