Skip to content

whisper : reject audio too short for reflective padding#3925

Open
hellopahe wants to merge 1 commit into
ggml-org:masterfrom
hellopahe:3923fix
Open

whisper : reject audio too short for reflective padding#3925
hellopahe wants to merge 1 commit into
ggml-org:masterfrom
hellopahe:3923fix

Conversation

@hellopahe

Copy link
Copy Markdown

log_mel_spectrogram reflective-pads the start of the signal by copying the first WHISPER_N_FFT/2 samples back-to-front. That length is fixed, so anything shorter than the pad window reads off the end of the input buf.

Fixes #3923

This PR goes with rejecting short input and returning false.
Added a small regression test, in which a couple of very short buffers get rejected and a just-long-enough one still goes through.

AI disclosure: claude code helped write the test.

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.

Heap out-of-bounds read in log_mel_spectrogram() on very short audio (fewer than 201 samples)

1 participant