native icon indicating copy to clipboard operation
native copied to clipboard

fix: clamp spectrum band bins against Nyquist to prevent out-of-bounds read

Open mvanhorn opened this issue 4 months ago • 1 comments

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 avatar Jul 15 '26 15:07 mvanhorn

@mvanhorn is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Jul 15 '26 15:07 vercel[bot]