mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-10-26 19:19:10 -06:00
The vendored hayro-syntax passed each filter an output limit, but ASCII85 ignored it: every `z` expands one byte to four, so a Flate stage at its limit could be grown another 4x past every budget. ASCII85 now writes only what fits under the limit, stops with a warning once it is reached (like RunLength, LZW and Flate), and caps its starting capacity at the limit. Test: decompression_bombs_stop_at_the_stream_limit gets a [/FlateDecode /ASCII85Decode] bomb; it decoded 301,989,892 bytes before and stops at MAX_DECODED_STREAM now. Co-authored-by: skylar taylor-barrick <hi@skylar.cc> Co-authored-by: Brandon Thomas <echelon@gmail.com>