Commit Graph
2 Commits
Author SHA1 Message Date
dotCooCoo 8a2c27ee2d craft-hdr: refuse buffers past isize::MAX bytes when limits are raised
With a raised max_pixels on wasm32, a picture could pass every check and
then ask vec! for more than isize::MAX bytes for its scan line or its
float picture, which panics with a capacity overflow instead of returning
an error.

- decode checks the byte count of the scan line and of the float picture
  against isize::MAX before allocating either, and returns
  LimitExceeded("pixel count") when one is over.
- Each header line is measured as text after invalid bytes become U+FFFD,
  and a line over isize::MAX bytes is LimitExceeded("header length").
- The resolution line reads its first four tokens without collecting the
  rest.
- The size checks take the bound as a value, and tests check them against
  the 32-bit bound without allocating.
2026-11-13 13:43:35 -08:00
Dylan M. Taylor 49f5f5e83d craft-hdr: Radiance HDR (RGBE) picture reader (#925)
FilmCraft's clean-room Radiance HDR reader as a crate: flat, old and new
run-length scan lines, all eight axis orders, to linear float RGB. Scan lines
are validated before the float picture is allocated.
2026-11-11 18:41:32 -05:00