Skip to content

wasm: regenerate taf_encoder for the heap-cap / truncation fix#312

Closed
aflores-qb wants to merge 1 commit into
toniebox-reverse-engineering:developfrom
aflores-qb:fix/wasm-encoder-regen
Closed

wasm: regenerate taf_encoder for the heap-cap / truncation fix#312
aflores-qb wants to merge 1 commit into
toniebox-reverse-engineering:developfrom
aflores-qb:fix/wasm-encoder-regen

Conversation

@aflores-qb

Copy link
Copy Markdown

Fixes #281
Depends on / completes toniebox-reverse-engineering/teddycloud#453 (merged)

What

Regenerates the committed browser TAF encoder (public/wasm/taf_encoder.{js,wasm}) from the merged server-side fix in teddycloud#453.

That fix addresses #281: the encoder grew its output via buffer_write(), whose realloc() failure (-1) was ignored at every call site, so a long recording produced a silently truncated TAF reported as success (the reporter saw a 122-min file cut to ~83 MB). The C change propagates the failure and raises the WASM heap cap 256 MB → 2 GB. Since the compiled encoder is committed here as a binary, it must be regenerated for the fix to reach users — that's this PR.

Build provenance

  • Built with make wasm (the repo's existing target) using emcc 6.0.0, from teddycloud develop after #453 merged, with the Makefile's emscripten flags unchanged.
  • Output is essentially the same shape as before (js 38135→38567 B, wasm 332180→332175 B), and exports the same API (createTafEncoder, _taf_encoder_create/encode/finalize/get_buffer/get_size/free); the .wasm magic is valid (\0asm).

Testing note

emscripten/a browser aren't available in CI here, so I could not run an in-browser encode. The underlying C change was verified on the server side via the native make wasm_test build (compiles clean; a 20 s PCM encode yields a valid TAF with correct OggS pages). If you'd rather regenerate this with your own toolchain to be safe, that's totally reasonable — happy to defer to that.

Targeted at develop.

Rebuilds the committed browser TAF encoder from the merged server-side
fix (toniebox-reverse-engineering/teddycloud#453), which propagates
buffer_write() failures and raises the encoder heap cap 256MB -> 2GB so
long recordings no longer produce a silently truncated TAF.

Built with `make wasm` (emcc 6.0.0) from teddycloud `develop`, with the
exact Makefile flags unchanged. Fixes teddycloud_web#281.
@SciLor

SciLor commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

I've added the emsdk to the submodules and build it this way myself.
Thank you for running the test on the wasm.

@SciLor SciLor closed this Jun 8, 2026
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