You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
container: Matroska lacing unlaces without a frame bound (about 13 KiB allocated per input byte) #120
container.NewReader unlaces every Matroska SimpleBlock up front (matroska_read.go:450-480, 495-506), and no bound on the number of frames is applied before that. A caller's MaxTrackSamples is only checked later, by consumers such as decode.PosterFrame. A probe never reaches that check.
A 7-byte SimpleBlock with fixed lacing and lace count byte 0xFF unlaces into 256 empty frames, and ebml-go accepts it (unlacer.go:113-117). Measured natively through go-avkit/worker's Handle (probe, default limits), with avkit v0.16.0:
File
Blocks
Allocated
7.2 KB
1,000
95 MiB
70 KB
10,000
925 MiB (HeapSys 555 MiB, GOMEMLIMIT=512MiB)
The growth is linear, about 13 KiB allocated per input byte. A 1.8 MB file reaches about 14 GiB, beyond the 4 GiB address space of a wasm worker.
Wanted: the reader enforces a frame (sample) budget while unlacing, with a refusal error, before it allocates. Either take a limit from the caller, or have a default that the caller can only lower. Add a bomb test that asserts the REFUSAL under GOMEMLIMIT, and a fuzz seed for a maximal lace count. This is the same family as #113 (MP4 box count). Callers' pre-scans (go-avkit/worker scanEBML) are being fixed to count lace frames meanwhile, but the bound belongs in the reader.
The same gap exists in go-slides' own pre-scan: see go-slides/slides#106, whose fix is pending. go-avkit/worker v0.1.0 already counts lace frames in its pre-scan. The reader-level bound is #121.
Activity
serve: count the frames of laced Matroska blocks; recover at the boun…
worker: proto, serve and the js/wasm Web Worker (#1)
tannevaled commentedon Nov 14, 2026
The same gap exists in go-slides' own pre-scan: see go-slides/slides#106, whose fix is pending. go-avkit/worker v0.1.0 already counts lace frames in its pre-scan. The reader-level bound is #121.
serve: derive the EBML master set from ebml-go's element table (#2)
playground: the video worker is go-avkit/worker v0.1.1
playground: video support is a module of its own, loaded on demand (#139