Commit Graph
12 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
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 2e2747c129 Overhaul Make makefiles
* Header files and correspondent C sources that define
    functions recently added to public API moved from
    'tools' directory to root

  * By default, install prefix is '/usr/local/', and header
    install path is '${PREFIX}/include/kissfft'

  * Added detection of external libraries like FFTW or libPNG

Signed-off-by: Vasyl Gello <[email protected]>
2021-02-05 13:34:16 +02:00
Mark Borgerding 6b23ebb5c1 getting ready for v100 2003-12-15 03:23:46 +00:00
Mark Borgerding 573536f48f fixed scaling for short real
moved fft.py from ./ to sample_code
2003-12-14 05:13:11 +00:00
Mark Borgerding 559c14b49b changed alloc functions to allow for initialization of user-supplied buffer 2003-12-14 03:02:30 +00:00
Mark Borgerding 8a992d0e98 better, reduced mutliply in real fft 2003-12-10 05:48:42 +00:00
Mark Borgerding b737756abb real fwd and rev fft works 2003-12-09 04:10:50 +00:00
Mark Borgerding 14e9b0dce4 about to start working on real inverse fft optimzation 2003-12-09 01:51:29 +00:00
Mark Borgerding 008d7fd4ea zero case optimized 2003-12-09 01:37:48 +00:00
Mark Borgerding 548032e305 real optimization 2003-12-09 01:25:47 +00:00