import-examples/12-15-import-formats/Ip046.drc
Sources
- Pattern-mined from google/draco#1169 (Apache-2.0 — pattern only
- bytes regenerated via DracoPy, not copied).
Description
The Edgebreaker connectivity header carries a `num_faces` varint that the decoder historically fed to `vector::reserve()` with no bound against the remaining buffer. A tiny (~80-byte) file can therefore claim billions of faces while supplying almost no symbol payload. A robust decoder must bound the declared count against the bytes actually remaining before it allocates.
Reproducer recipe
Encode the tetra base mesh; replace the single-byte `num_faces` varint at file offset 12 (value 4) with the 5-byte varint `FF FF FF FF 0F` (~4.29 billion). Body is otherwise untouched.
Expected kernel behavior
Validate `num_faces` against the remaining buffer size before any reserve/allocation; reject with a clear diagnostic. Never size an allocation from an unvalidated stream count.
Notes
DracoPy 2.0.0 result observed: `FileTypeException: Input mesh is not draco encoded`. The decode returns immediately with a generic reject — no OOM, no hang; the generic error string does not confirm which check fired (header-parse vs. the `num_faces` bound), only that this build does not allocate from the unvalidated count. Synonyms: "count-driven allocation bomb", "codec-internal reserve() bomb", "unbounded num_faces". Provenance tier: bytes-only.
Expected validation
Provenance tier
bytes-only — defect not fully embodied in fixture bytes.
Byte assertions
contains(b'DRACO')
Live oracle output
No live oracle data — run _run_corpus to populate.
Fixture content
Show fixture bytes (with defect highlighting)
1DRACO ÿÿÿÿ ßÿ"ÿ ( 2³
ÂB ÿ? ?