ejmahler / RustFFT

RustFFT is a high-performance FFT library written in pure Rust.
Apache License 2.0
678 stars 47 forks source link

0 size input on Avx::plan_fft_forward spins #53

Closed JulianKnodt closed 3 years ago

JulianKnodt commented 3 years ago

Hi,

Thank you for the wonderful crate, I had a go at implementing a basic FFT algo for fun and using this crate as reference. I was fiddling around with inputs and realized that if I passed 0 in FftPlanner::new().plan_fft_forward(0), it spun without finishing.

I looked through, and retried with the FftPlannerAvx in specific and found that it spun there.

I'm not sure what the intended behaviour should be, but I think it'd be useful to know if it was invalid input rather than having it spin.

Edit: looking through the src, I also should note I was using f32, not sure if that makes a difference

ejmahler commented 3 years ago

I try to make sure that it degrades gracefully with a plan size of 0, but clearly something went wrong here. Thanks for reporting!