Files
craft-libs/crates
dotCooCoo 39c54686f5 craft-cdr: .cmx no longer drops a page that stray letters' length covers
When stray bytes held four letters whose length covered the page chunk
after them, the reader resumed at those letters, read the page as their
body and dropped it without a warning.

After stray bytes the reader still resumes at the first chunk id it
finds. It resumes instead at a page chunk 8 to 64 bytes inside the body
of that chunk only when that chunk is one the reader passes over or a
page, the inner page reaches the outer chunk's end, the page reads with
objects and without damage in its instructions, and walking on from
both places reaches the same position or the end of the list within 16
steps, with every chunk read on the first walk also read on the second
(pages without objects aside). Of the chunks only the second walk
reads, the header or a table is used only when no other chunk of its
id is read. Letters spelling `page` whose length runs past the list are
checked the same way. In one read, the search for pages to resume at
spends at most four times the length of the RIFF form, or 1,048,576
when that is more, counting 64 for each step of a walk and the length
of each page body judged; past that, the reader resumes at the first
chunk id found. Pages kept this way are read after the other pages and
keep their place in the file. Each is judged again before it is read.
One that a limit stops, or leaves without objects, is left out with the
warning for limits; one the limits cut short is read as far as they
allow, as other pages are.

Resuming at an inner page, at a chunk the reader passes over that is
not followed by another chunk id or the end of the list, or after
letters whose length runs past the list adds the damage warning.

Tests read every file a second time with the recovery turned off and
check that a file this second read opens still opens, and that no page
it reads with objects is lost; both property tests do the same. R53 in
PROVENANCE.md states the rule.

Ports https://github.com/storytold/vectorcraft/pull/8866.
2026-11-21 14:56:56 -08:00
..
2026-11-14 17:49:47 +01:00
2026-11-13 01:31:26 -05:00
…