Files
lightcraft/docs
Claude c2cdb112b7 LR-IMP-FORMATS: GIF and BMP sizes from the header; a canvas the file can't fill is refused (#2553)
read_header had no reader for GIF or BMP and fell back to a full decode, so a few-dozen-byte file
declaring a canvas just under the 1-gigapixel limit made the import probe allocate ~4.3 GB; a
failed allocation aborts the process. A decode had the same allocation.

- other::header reads the size from the header. A canvas up to 4 MP is still decoded there, so
  truncated small files are refused at import as before.
- check_fillable refuses a canvas larger than the file's bytes can describe (BMP: 128 pixels per
  byte, covering 1-bit and RLE; GIF: 11,000, an LZW code of at least 3 bits expanding to at most
  4096 pixels), in both the probe and the decode, before the decoder allocates.
- The GIF and BMP decoders get an allocation limit (the RGBA buffer of max_pixels).

The approach follows the abandoned #2182 (PierrunoYT). JPEG XL still decodes in the probe.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K93HTyCiwYvbRGaAkjPvXn
2026-10-22 10:55:54 -07:00
..
2026-10-22 02:49:52 +00:00
2026-10-15 03:24:51 -04:00
2026-10-14 22:32:33 -04:00
2026-10-22 02:53:42 +00:00
2026-10-08 20:20:17 +00:00
2026-10-22 02:49:52 +00:00
2026-10-14 01:29:30 -04:00
2026-10-15 01:48:43 -04:00
2026-10-22 02:53:00 +00:00