Commit Graph
1933 Commits
Author SHA1 Message Date
Dylan M. Taylor 32b2fd8adf media: cap a Matroska track's content encoding chain (#541)
A track could list any number of ContentEncoding entries, and readers walk
the whole list for every frame they return (frames_readable,
stripped_header). A track with more than 16 entries, far beyond the one or
two a muxer writes, is now treated as having an unsupported compression, so
its frames are returned as stored and the list is never long.
2026-11-03 14:10:50 -05:00
dotCooCoo 37ec49baca craft-doc: validate explicitly zero ICC frame sizes 2026-11-03 11:09:25 -08:00
dotCooCoo af2df05a35 craft-doc: retain full composite provenance in renditions 2026-11-03 10:40:31 -08:00
dotCooCoo 21a7644df4 craft-doc: keep ICC helper separate from metadata additions 2026-11-03 10:17:44 -08:00
dotCooCoo ee2d912f24 craft-doc: read a bounded PhotoCraft ICC payload 2026-11-03 10:08:44 -08:00
dotCooCoo 51c11d7b75 doc: explain metadata reader regression invariants 2026-11-03 10:01:48 -08:00
dotCooCoo 6e909558c1 PDF: compile the CCITT row helper only with images 2026-11-03 09:59:55 -08:00
dotCooCoo 1b3a3ed661 font-store: clarify the lock acquisition cleanup sweep limit 2026-11-03 09:31:01 -08:00
dotCooCoo e0738f2a0f PDF: cover cancellation in xref stream fallback 2026-11-03 09:19:21 -08:00
dotCooCoo 7b8566b25c font-store: bound removal cleanup and cover portable failure retries 2026-11-03 09:11:49 -08:00
dotCooCoo c8aeab2226 hayro-interpret: refresh the local image-reader digest 2026-11-03 09:05:50 -08:00
dotCooCoo a017817164 PDF: remove an unused JPX macro import 2026-11-03 09:03:01 -08:00
dotCooCoo b04ab28441 craft-doc: read a caller-defined PhotoCraft document head 2026-11-03 09:01:43 -08:00
dotCooCoo 9c9fdda76c font-store: make rollback recovery fixture portable 2026-11-03 08:56:21 -08:00
dotCooCoo 616d5b9ae0 craft-doc: test oversized unused composite previews 2026-11-03 08:18:55 -08:00
dotCooCoo de727cb97e font-store: preserve Language packs when removal cannot commit 2026-11-03 08:12:39 -08:00
dotCooCoo 87df9aab62 craft-doc: recover intact metadata before a damaged gzip tail 2026-11-03 07:40:29 -08:00
dotCooCoo a5a162a87a PDF: bound cancellation work in coded blocks and stream repair 2026-11-03 07:14:43 -08:00
dotCooCoo f686f6c3f6 PDF: allow opening to be canceled during parsing 2026-11-03 06:33:31 -08:00
dotCooCoo c395cdc092 craft-doc: keep helpers before the test module 2026-11-03 06:17:53 -08:00
Aleksander HelgakerandClaude Opus 5.5 6865897f14 craft-media: add Ogg demuxer (#440)
* craft-media: Ogg demuxer

FilmCraft's `filmcraft-ogg` as `craft_media::ogg`, behind the opt-in
`ogg` feature: pages (CRC-32 checked, damage skipped by searching for
the next `OggS`), logical streams, packets across pages, and the Ogg
Opus, Vorbis and FLAC mappings. `OpusTiming` gives each Opus packet's
start, the pre-skip and the final page's end trimming.
`Stream::codec_params()` returns `CodecParams` like the other
containers; for FLAC each stream keeps its own header count, and an
unstated count is bounded (it ends at the first audio frame, or at
32 MiB with a warning). `ogg::ByteSource` is `craft_media::ByteSource`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* craft-media: Ogg review fixes: bounded recovery, lost pages, chained links, caps

From the review of the Ogg demuxer (storytold/craft-libs#440):

- The damage scan charges the positions it examines, not a whole 1 MiB read,
  reads 64 KiB at a time, and says when the 64 MiB budget runs out. A file
  with many damaged pages lost its tail without a warning.
- A page whose lacing claims more bytes than the file has left is skipped
  and the scan resumes, instead of ending the parse.
- A gap in a stream's page sequence numbers drops the packet the lost page
  continued; its two ends were joined into one corrupted packet.
- A beginning-of-stream page for a serial already seen starts a new stream,
  so a chained file whose links reuse a serial no longer hands the second
  link's headers to the decoder as audio.
- The packets kept from a file are capped by its size (as Matroska caps
  frames), so zero lacing values cannot make the packet lists many times the
  file. FLAC metadata under an unstated header count must be a block of the
  length its header states, and at most 1024 are kept.
- A packet over 4 GiB is dropped instead of overflowing its size.
- OpusTiming saturates, so hostile granule positions cannot overflow, and a
  clip whose only audio page is also the last is trimmed at the end
  (RFC 7845 §4.5) instead of at the start.
- Speex streams read extra_headers (offset 68) for their header count.
  codec_params gives Theora its Xiph-laced headers and Speex its header,
  rate and channels; the FLAC extradata flags exactly the last block.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* craft-media: Ogg damage recovery charges every page it reads and hashes

From CodeRabbit's review of 2308071: a page that fails its CRC was read and
hashed in full (up to about 64 KB) before the parser stepped one byte on,
and the damage scan read 64 KiB per call however near the next page was.
Neither was charged to the recovery budget, so a file packed with fake page
headers could cost gigabytes of reading and hashing.

- A failed page's bytes are charged to the recovery budget; opening stops
  with a warning when it is spent.
- find_capture starts with a 256-byte read and doubles it up to 64 KiB.
- Warnings about damaged pages are capped at 1024, with a closing count of
  the rest.
- Filing a completed packet as header or audio moves into Stream::add_packet,
  keeping open under the cognitive-complexity limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* craft-media: Ogg recovery budget in proportion to the file; stray BOS; header caps

- Damage recovery charges every byte it reads again (a high-water mark), against a budget of
  twice the file's length plus 1 MiB, instead of a fixed 64 MiB that cut off large damaged
  files. A page's body is read without reading its header again, so a page is not charged twice.
- A beginning-of-stream page that carries on the page sequence of a stream with no
  end-of-stream page yet is a stray flag: a warning, and the stream is not split. A link that
  starts again before its end-of-stream page warns.
- Header packet counts a file states (FLAC, Speex) are capped like the unstated FLAC count.
- Reserved FLAC metadata block types (7-126) are metadata blocks.
- Theora codec_params carries the picture size; the extradata table lists Theora and Speex.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* craft-media: Ogg header reads checked before they are made; scan span on 32-bit

- A header packet past the size cap is checked by its stated size and not read, and a stream's
  first packet is read once (only its first 80 bytes when it is too large to be a header).
- MAX_HEADER_BYTES is 64 MiB, room for two of the largest FLAC metadata blocks with their block
  headers and the rest of the headers.
- find_capture clamps the scan span in u64 before casting, so a span of 2^32 bytes cannot become
  0 on 32-bit targets.
- The Recovery doc says which reads it charges, and what header packet reads add.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 09:06:14 -05:00
dotCooCoo 5f3aed6309 craft-doc: add cooperative cancellation to document reads 2026-11-03 05:56:54 -08:00
dotCooCoo e2f2337f11 vectorcraft-format: read PDF preference with document contents 2026-11-03 03:57:13 -08:00
NaxvogandClaude Opus 5.5 b732f2abc7 proof: cap .aff REP replacements at parse time (storytold/wordcraft#3655)
Both readers kept every REP line: an .aff with hundreds of thousands of
entries, or megabyte-long patterns and replacements, made each
suggestion round hang and allocate hundreds of MB. push_rep keeps at
most 4096 entries, drops patterns longer than MAX_LETTERS letters (no
suggester takes a longer word, so they never match) and replacements
longer than MAX_WORD_BYTES.

Ported from storytold/wordcraft#4632, which can't land now that
proofing lives here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 07:10:24 +01:00
dotCooCoo 7c86e166bd craft-doc: check rendition copy costs before decompressing 2026-11-02 21:08:18 -08:00
Dylan M. Taylor 55332dd301 font-store: index PostScript names shared by many files in linear time (#538)
Index::assemble searched every earlier position listed under a PostScript
name before adding the next, so an index that gives one name to many files
took time quadratic in their number. Files are visited in order, so a file
that lists a name twice can only be the last position pushed: comparing
with the end is enough.

find_postscript compared each hit's family name with every name collected
so far; it now keeps the lowercased names in a set.
2026-11-02 23:56:48 -05:00
dotCooCoo e833d736b3 craft-doc: prefer the optional full-size PhotoCraft composite 2026-11-02 20:39:03 -08:00
dotCooCoo d6dab40b02 Merge commit 'refs/check/cd-followups-new-main' into feat/doc-selected-rendition 2026-11-02 20:34:32 -08:00
dotCooCoo 3f9a81642e craft-doc: read a selected rendition without extracting other payloads 2026-11-02 20:34:32 -08:00
Dylan M. Taylor 6ae033e6c1 Merge pull request #525 from dotCooCoo/feat/doc-pcraft-pixels
craft-doc: PhotoCraft layer pixels and masks behind the pcraft-pixels feature
2026-11-02 23:29:19 -05:00
Dylan M. Taylor 9257c78cef Merge pull request #508 from cdhdt/update-dialog-translations
craft-update: the update dialogs take the app's translator
2026-11-02 22:52:25 -05:00
Dylan M. Taylor 269629ee8c Merge pull request #107 from euisuh/fix/settings-permission-test-portability
test(settings): respect effective filesystem permissions
2026-11-02 22:48:25 -05:00
Dylan M. Taylor 11a6018c60 Merge pull request #524 from dotCooCoo/fix/craft-doc-review-points
craft-doc: read envelopes as the format crates and apps do
2026-11-02 22:48:21 -05:00
Dylan M. Taylor 30bd8483ad Merge pull request #535 from storytold/fix/sec-fontconfig-include-dirs
font-catalog: list each fontconfig include folder once, within a budget
2026-11-02 22:46:46 -05:00
Dylan M. Taylor 071113544b Merge pull request #534 from storytold/fix/sec-docpath-native-prefix
docpath: hold a non-Unicode document's root to the namespace rules
2026-11-02 22:46:42 -05:00
Dylan M. Taylor 2e40c0329f Merge pull request #533 from storytold/fix/sec-cms-inverse-edges
cms: find a sampled inverse curve's flat ends once per pipeline
2026-11-02 22:46:39 -05:00
Dylan M. Taylor 23738e1650 Merge pull request #532 from storytold/fix/sec-color-space-depth
hayro-interpret: bound how deeply color spaces may nest
2026-11-02 22:40:31 -05:00
Dylan M. Taylor 31e54f7e41 Merge pull request #531 from storytold/fix/sec-xref-entry-cap
hayro-syntax: cap a document's xref map at the PDF object limit
2026-11-02 22:40:16 -05:00
Dylan M. Taylor 80bbc2939c Merge pull request #530 from storytold/fix/sec-jbig2-decode-limit
hayro-syntax: hold a JBIG2 page to the stream's decode limit
2026-11-02 22:39:43 -05:00
Dylan M. Taylor c0b58fdb45 Merge pull request #529 from storytold/fix/sec-plate-test-tempdir
plate-test: separate plates in a private random temporary directory
2026-11-02 22:29:15 -05:00
Dylan M. Taylor 299112d789 Merge pull request #528 from storytold/fix/sec-fonts-build-paths
fonts-build: keep manifest font and licence paths inside the checkout
2026-11-02 22:29:12 -05:00
Dylan M. Taylor 0329fe14de Merge pull request #527 from storytold/fix/sec-fonts-build-cmap
fonts-build: read each shared cmap subtable once
2026-11-02 22:29:09 -05:00
Dylan M. Taylor 7eac928440 Merge pull request #468 from carkrueger/fix/cascade-on-real-monitors
window: cascade new windows on the real monitor
2026-11-02 22:26:48 -05:00
Dylan M. Taylor 9a20fdbe1d Merge pull request #267 from fluorine/fix/fonts-build-ui-paths
Fix native path assertion in font embedding test
2026-11-02 22:24:39 -05:00
Dylan M. Taylor 90f9f9aa18 Merge pull request #476 from dotCooCoo/fix/keymap-iso-key-shift-symbol
keymap: test that Shift on the ISO key typing a symbol is dropped
2026-11-02 22:24:35 -05:00
Dylan M. Taylor 2bd8f60e15 Merge pull request #367 from lehni/fix/native-bar-title
docking: a native floating window's bar shows no title, as its tab names the panel
2026-11-02 22:16:24 -05:00
Dylan M. Taylor 9d4f20aa03 Merge pull request #522 from vangel76/perf/bitreader-expgolomb-517
bitstream: decode short Exp-Golomb codes with one peek, write ue(v) in one call (#517)
2026-11-02 22:07:16 -05:00
dotCooCoo 3cdeca266a craft-doc: bound shared tile conversion and reject trailing frames 2026-11-02 19:07:05 -08:00
Dylan M. Taylor 1508ae6d63 Merge pull request #521 from vangel76/perf/rbsp-unescape-518
bitstream: copy runs in unescape_rbsp instead of pushing byte by byte (#518)
2026-11-02 22:06:14 -05:00
Dylan M. Taylor 8e717b26da Merge pull request #519 from vangel76/perf/bitreader-peek-516
bitstream: one 8-byte load in BitReader::peek, bit reads 2.5x faster (#516)
2026-11-02 22:05:14 -05:00