8000 fix(pitch): keep yinfft's weighting lookup inside its table by shauneccles · Pull Request #448 · aubio/aubio · GitHub
[go: up one dir, main page]

Skip to content

fix(pitch): keep yinfft's weighting lookup inside its table - #448

Open
shauneccles wants to merge 1 commit into
aubio:masterfrom
LedFx:fix/pitchyinfft-weight-table
Open

shauneccles wants to merge 1 commit into
aubio:masterfrom
LedFx:fix/pitchyinfft-weight-table

Conversation

@shauneccles
Copy link
Copy Markdown

new_aubio_pitchyinfft interpolates a psychoacoustic weight for every
spectrum bin from a table ending at 25.1kHz. Above 50.2kHz (88.2k, 96k,
192k) bins run past it: the first search stopped on the -1 terminator and
read weight[34], one past the end, then the second search walked past the
terminator itself, since every frequency is greater than -1. Reproduced
under ASan with new_aubio_pitchyinfft(96000, 256).

The search now stops at the last table entry, and bins above it hold the
last weight (-17.8dB, which the last three entries already share). Weights
are unchanged for every samplerate up to 48kHz (checked for 8k-48k at
buffer sizes 256-4096).

Tests: the C test builds yinfft at 48k-192k, which aborts under ASan
without the fix (sanitizers.yml); a Python test tracks a 440Hz sine at
96kHz.

Closes #435.

Split out of #432. Checked together with the other small fixes on top of master plus #447: meson test 52/52 ok, and pytest python/tests on the setup.py build 600 passed, 51 skipped.

🤖 Generated with Claude Code

new_aubio_pitchyinfft interpolates a psychoacoustic weight for every
spectrum bin from a table ending at 25.1kHz. Above 50.2kHz (88.2k, 96k,
192k) bins run past it: the first search stopped on the -1 terminator and
read weight[34], one past the end, then the second search walked past the
terminator itself, since every frequency is greater than -1. Reproduced
under ASan with new_aubio_pitchyinfft(96000, 256).

The search now stops at the last table entry, and bins above it hold the
last weight (-17.8dB, which the last three entries already share). Weights
are unchanged for every samplerate up to 48kHz (checked for 8k-48k at
buffer sizes 256-4096).

Tests: the C test builds yinfft at 48k-192k, which aborts under ASan
without the fix (sanitizers.yml); a Python test tracks a 440Hz sine at
96kHz.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Global OOB read in new_aubio_pitchyinfft when constructing aubio_notes at certain samplerates

2 participants

0