kfrlib / kfr

Fast, modern C++ DSP framework, FFT, Sample Rate Conversion, FIR/IIR/Biquad Filters (SSE, AVX, AVX-512, ARM NEON)
https://www.kfrlib.com
GNU General Public License v2.0
1.64k stars 252 forks source link

Possible bug in nearest_real_or_complex #137

Closed shurtlifkeysight closed 10 months ago

shurtlifkeysight commented 3 years ago

I've been having a pesky vector out of range error pop up in my program when running the to_sos function from iir_design.hpp. I think I've traced one of these errors to line 938. Here there's a for loop that's running over the size of the input list but the vector it is indexing it with (filtered) is always going to be <= the size of the input list, which could cause indexing past the end of the vector.

dancazarin commented 10 months ago

Fixed in dev branch. Will be moved to main once full tests complete.