Skip to content

resampler: Bound delay_line::output reads to buffered frames#847

Open
kinetiknz wants to merge 1 commit into
masterfrom
delay-line-output-bounds
Open

resampler: Bound delay_line::output reads to buffered frames#847
kinetiknz wants to merge 1 commit into
masterfrom
delay-line-output-bounds

Conversation

@kinetiknz

Copy link
Copy Markdown
Collaborator

The pointer-returning delay_line::output copied frames_to_samples(frames_needed) samples out of delay_input_buffer unconditionally. When the delay line holds fewer frames than requested - as happens at stream startup or during a capture underrun in a duplex stream that resamples only its output side - this read past the end of the buffer.

Copy only the buffered samples, zero-pad the remainder, and report the number of frames actually consumed, mirroring the underrun handling already present in cubeb_resampler_speex_one_way::output.

The pointer-returning delay_line::output copied frames_to_samples(frames_needed)
samples out of delay_input_buffer unconditionally. When the delay line holds
fewer frames than requested -- as happens at stream startup or during a capture
underrun in a duplex stream that resamples only its output side -- this read
past the end of the buffer.

Copy only the buffered samples, zero-pad the remainder, and report the number
of frames actually consumed, mirroring the underrun handling already present in
cubeb_resampler_speex_one_way::output.
@kinetiknz kinetiknz requested review from Pehrsons and padenot June 10, 2026 09:58
@kinetiknz kinetiknz self-assigned this Jun 10, 2026
@padenot

padenot commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

We should merge #841 instead, no?

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.

2 participants