vectorcraft/crates/affinity/src
callmeBalloch 67a62a7fe7
AF.3: bound the values a document stream decodes
A value takes about 40 bytes in memory however few it took in the file,
and a bool array packs eight in a byte, so a small, highly compressed
doc.dat could declare billions of values and make the import abort on
allocation (review on storytold/vectorcraft#667). The parser now counts
fields and array elements against a 2^24 budget before allocating, and
reserves array storage fallibly, returning Error::Limit either way.
The largest of 333 public documents decodes 3.3 million values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GQPh8UDgMyARR5Hat9UchC
2026-10-09 04:31:42 +00:00
..
access.rs AF.2: bounded Affinity archive and object-stream reader 2026-10-08 17:09:56 +00:00
container.rs AF.2: bounded Affinity archive and object-stream reader 2026-10-08 17:09:56 +00:00
geometry.rs AF.3: native Affinity import with artboards, vectors, text and images 2026-10-08 17:58:11 +00:00
lib.rs AF.3: native Affinity import with artboards, vectors, text and images 2026-10-08 17:58:11 +00:00
model.rs AF.3: native Affinity import with artboards, vectors, text and images 2026-10-08 17:58:11 +00:00
paint.rs AF.3: native Affinity import with artboards, vectors, text and images 2026-10-08 17:58:11 +00:00
preview.rs AF.2: bounded Affinity archive and object-stream reader 2026-10-08 17:09:56 +00:00
raster.rs AF.3: native Affinity import with artboards, vectors, text and images 2026-10-08 17:58:11 +00:00
shapes.rs AF.3: native Affinity import with artboards, vectors, text and images 2026-10-08 17:58:11 +00:00
stream.rs AF.3: bound the values a document stream decodes 2026-10-09 04:31:42 +00:00
synth.rs AF.2: bounded Affinity archive and object-stream reader 2026-10-08 17:09:56 +00:00
tests.rs AF.3: bound the values a document stream decodes 2026-10-09 04:31:42 +00:00
text.rs AF.3: native Affinity import with artboards, vectors, text and images 2026-10-08 17:58:11 +00:00