Skip to content

fix(codecs): respect finite WAV data sizes - #8455

Draft
peterolkhov wants to merge 1 commit into
livekit:mainfrom
peterolkhov:codex/limit-wav-decoding-to-audio-data
Draft

peterolkhov wants to merge 1 commit into
livekit:mainfrom
peterolkhov:codex/limit-wav-decoding-to-audio-data

Conversation

@peterolkhov

@peterolkhov peterolkhov commented Nov 8, 2026 •

Copy link
Copy Markdown

The inline WAV decoder reads through the end of the file after a data header. A valid footer chunk therefore becomes PCM, adding nonzero samples and extra playback to an otherwise silent clip.

Limit positive finite data payloads before framing and resampling. Zero and 0xFFFFFFFF keep their existing unknown-length behavior, and a fresh RIFF header resets the budget for the next WAV.

The regressions fail on the unmodified base and pass with the fix, covering whole and split input, a partial final frame, and public TTS emitter bytes and duration. make check passes; make unit-tests PYTEST_ARGS='-n 2 -ra' passes with 7,180 passed and five cloud/platform-dependent skips on macOS/Python 3.13. The local room fixture used the official LiveKit server v1.13.11 built from its pinned source.

AI assistance: OpenAI Codex (GPT-6.1 Sol, high reasoning) investigated, implemented, and tested this change. No human code review is claimed.

Draft pending the contributor agreement.

The inline decoder treated footer chunks as PCM after a bounded data chunk,
adding non-audio samples and extra playback. Limit framing to the declared
payload while preserving streaming size markers and per-file reset.
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

This branch has not been deployed

No deployments
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