Commit Graph
10 Commits
Author SHA1 Message Date
Davide FacontiandClaude Opus 5.5 24fa326186 kiss_fft: validate sizes in the alloc functions and next_fast_size
- kiss_fft_alloc(0) passed the overflow check and computed
  sizeof(kiss_fft_cpx)*(nfft-1) with nfft-1 == -1, returning a config.
  Reject nfft <= 0 (negative sizes were only rejected by accident of the
  signed/unsigned comparison, which is now an explicit cast).
- kiss_fftr_alloc(0) halved 0 and built a config around a NULL
  sub-state. Reject nfft <= 0 along with odd sizes, and compute
  nfft*3/2 in size_t.
- kiss_fftnd_alloc multiplied the dimensions in an int, so {65536,65536}
  wrapped to 0 and {46342,46342} to a negative value: the size query
  reported a bogus size and a far too small buffer was accepted. Reject
  dims <= 0 and products that do not fit in an int (st->dimprod) or whose
  buffer size overflows size_t, reporting *lenmem = (size_t)-1 as
  kiss_fftndr_alloc does.
- kiss_fft_next_fast_size incremented n past INT_MAX for
  n > 2125764000 (the largest 2,3,5-smooth int) and returned a negative
  value. It now returns n itself there (documented in kiss_fft.h): no
  2,3,5-smooth int >= n exists, and n is still a valid, if slower, size
  for callers that pass the result straight to an alloc.
- kfc.c read an uninitialized length when the size query rejected nfft;
  it now returns NULL for an invalid size.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01ME1hnNaoD3ZcMj9H8TSYkZ
2026-11-11 10:12:39 +01:00
zhouyunding 80aec22623 Fix infinite loop in kiss_fft_next_fast_size for n<=0 (issue #121)
kiss_fft_next_fast_size(0) never terminated because the factorization
loop divides m by 2/3/5 forever when m stays 0. Per maintainer decision,
return 1 for n<=0. Add regression test next_fast_size covering n=0,
n<0 and positive inputs.
2026-10-21 20:05:00 +08:00
mborgerdingandGitHub 6398d8a1d0 Merge pull request #111 from HecaiYuan/master
loongarch: add loongarch simd opt
2026-05-11 20:03:41 -04:00
dmoandGitHub 797c8ca9eb FIx python binary detection (#119) 2025-11-28 20:14:24 +01:00
MartinandGitHub 6c56a03a6b tests/CMakeLists.txt: Fix CMP0148 (#108)
See `cmake --help-policy CMP0148`
2025-09-12 07:36:15 +02:00
yuanhecai eeb2e98ff6 loongarch: add lasx simd opt 2025-09-01 18:07:43 +08:00
yuanhecai c94458d8f2 loongarch: add lsx simd opt 2025-09-01 18:07:39 +08:00
Vasyl Gello cccf41adf2 Overhaul CMake makefiles
* Minimum CMake version lowered to 3.6 (tested on 3.6.1)
  * Refactored CMake configuration options

Signed-off-by: Vasyl Gello <[email protected]>
2021-02-05 13:34:16 +02:00
Vasyl Gello 7651bdaaa1 Increase CTest interval
* Fixes failing testcpp by timeout

Signed-off-by: Vasyl Gello <[email protected]>
2021-01-21 17:07:39 +02:00
Anonymous Maarten a63dfc7f11 Build tools + tests with cmake + add VERSION + parallel install 2020-10-30 02:49:49 +01:00