pdfcraft/vendor/lopdf/tests
Brandon Thomas 1449b71a19 Never crash: bound the allocations behind the nightly fuzz runner's out-of-memory deaths
Fuzzed inputs drove one check-one process to 2-6 GB (the 16 GB CI runner
running two of them was killed every night). Three causes, each with a test:
- lopdf (bootstrap inspector) sized PNG predictor rows from /Columns before
  reading data: /Columns 4294967295 allocated two 4 GiB rows. Vendored lopdf
  0.45.0 refuses rows longer than the data (and uses saturating row widths);
  its load-time stream decoding also gets a 256 MiB limit (it had none).
- hayro sized a tiling pattern's cell pixmap from /XStep x scale, bounded only
  by u16: a step far beyond /BBox allocated 2 GB. The vendored patch keeps
  the cell within 3000 px a side, lowering the resolution instead.
- cos decoded cross-reference streams up to the general 1 GiB limit; they now
  stop at what 8,388,607 objects' rows can hold (~200 MB at most), and the
  section is reconstructed (logged) instead.

On the nightly's seed (41) the worst captured input fell from 6.2 GB to 6 MB,
and a 300 s fuzz run had no process above 300 MB (before: many at 2-5 GB).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 17:59:25 -04:00
..
annotation.rs Never crash: bound the allocations behind the nightly fuzz runner's out-of-memory deaths 2026-10-04 17:59:25 -04:00
brotli_decode.rs Never crash: bound the allocations behind the nightly fuzz runner's out-of-memory deaths 2026-10-04 17:59:25 -04:00
catalog_compression_integration_test.rs Never crash: bound the allocations behind the nightly fuzz runner's out-of-memory deaths 2026-10-04 17:59:25 -04:00
decompression_bomb.rs Never crash: bound the allocations behind the nightly fuzz runner's out-of-memory deaths 2026-10-04 17:59:25 -04:00
decryption.rs Never crash: bound the allocations behind the nightly fuzz runner's out-of-memory deaths 2026-10-04 17:59:25 -04:00
document_load_performance.rs Never crash: bound the allocations behind the nightly fuzz runner's out-of-memory deaths 2026-10-04 17:59:25 -04:00
encrypted_object_stream_test.rs Never crash: bound the allocations behind the nightly fuzz runner's out-of-memory deaths 2026-10-04 17:59:25 -04:00
extract_test.rs Never crash: bound the allocations behind the nightly fuzz runner's out-of-memory deaths 2026-10-04 17:59:25 -04:00
font_test.rs Never crash: bound the allocations behind the nightly fuzz runner's out-of-memory deaths 2026-10-04 17:59:25 -04:00
incremental_document.rs Never crash: bound the allocations behind the nightly fuzz runner's out-of-memory deaths 2026-10-04 17:59:25 -04:00
linearized_objstm_test.rs Never crash: bound the allocations behind the nightly fuzz runner's out-of-memory deaths 2026-10-04 17:59:25 -04:00
load_options_test.rs Never crash: bound the allocations behind the nightly fuzz runner's out-of-memory deaths 2026-10-04 17:59:25 -04:00
metadata_test.rs Never crash: bound the allocations behind the nightly fuzz runner's out-of-memory deaths 2026-10-04 17:59:25 -04:00
modify.rs Never crash: bound the allocations behind the nightly fuzz runner's out-of-memory deaths 2026-10-04 17:59:25 -04:00
object_stream_comprehensive_test.rs Never crash: bound the allocations behind the nightly fuzz runner's out-of-memory deaths 2026-10-04 17:59:25 -04:00
object_stream_edge_cases_test.rs Never crash: bound the allocations behind the nightly fuzz runner's out-of-memory deaths 2026-10-04 17:59:25 -04:00
object_stream_methods_test.rs Never crash: bound the allocations behind the nightly fuzz runner's out-of-memory deaths 2026-10-04 17:59:25 -04:00
object_stream_performance_test.rs Never crash: bound the allocations behind the nightly fuzz runner's out-of-memory deaths 2026-10-04 17:59:25 -04:00
page_content.rs Never crash: bound the allocations behind the nightly fuzz runner's out-of-memory deaths 2026-10-04 17:59:25 -04:00
save_options_xref_streams_test.rs Never crash: bound the allocations behind the nightly fuzz runner's out-of-memory deaths 2026-10-04 17:59:25 -04:00
simple_object_stream_test.rs Never crash: bound the allocations behind the nightly fuzz runner's out-of-memory deaths 2026-10-04 17:59:25 -04:00
stream_length_recovery.rs Never crash: bound the allocations behind the nightly fuzz runner's out-of-memory deaths 2026-10-04 17:59:25 -04:00
trailer_reference_compression_test.rs Never crash: bound the allocations behind the nightly fuzz runner's out-of-memory deaths 2026-10-04 17:59:25 -04:00
unicode.rs Never crash: bound the allocations behind the nightly fuzz runner's out-of-memory deaths 2026-10-04 17:59:25 -04:00
utils.rs Never crash: bound the allocations behind the nightly fuzz runner's out-of-memory deaths 2026-10-04 17:59:25 -04:00
xref_reconstruction.rs Never crash: bound the allocations behind the nightly fuzz runner's out-of-memory deaths 2026-10-04 17:59:25 -04:00
xref_stream_bounds.rs Never crash: bound the allocations behind the nightly fuzz runner's out-of-memory deaths 2026-10-04 17:59:25 -04:00