native
native copied to clipboard
fix: clamp spectrum band bins against Nyquist to prevent out-of-bounds read
Summary
NativeSdkSpectrumComputeBands computed each band's low_bin from a log-spaced frequency and only clamped high_bin against the Nyquist limit. For the top bands, low_bin can exceed FFT_SIZE/2 - 1, so the inner accumulation loop read past the end of the magnitude buffer. This clamps low_bin against the same max_bin and skips (writes 0 for) any band whose range starts beyond Nyquist.
Closes #108
@mvanhorn is attempting to deploy a commit to the Vercel Labs Team on Vercel.
A member of the Team first needs to authorize it.