The recovery wrapper maps every non-decompress failure to Error::Invalid so a
limit refusal is never reported as truncated data. That arm had no test, which
left the changed lines under the coverage gate.
Pin only craft-psd to craft-libs main 9fc471fc (includes #1887
parse_prefix and #1885 PackBits recovery). Mid-stream descriptor
reads use Descriptor::parse_prefix, mapped back to the public
effectcraft Descriptor/DValue types. SoLd/SoLE/PlLd placements come
from craft_psd::smart::SmartObject, including quiltWarp, and
render_placed bakes through craft_psd::FloatImage.
Pixel decode stays local until a follow-up can check unmatte parity
on composite_f32.
Repin only craft-psd to craft-libs main e836b6fd (includes #1845).
lnk2 / lnkD / lnk3 / lnkE records come from craft_psd::smart::linked_files;
payload ranges are shifted from the block back into the document bytes.
is_linked_layer_key is the deferral predicate.
Descriptors, placed objects, and pixel decode stay local until
craft-libs#1887 (parse_prefix) and #1885 (PackBits recovery) are on main.
Psd::parse reads the header, colour mode data, layer records with their
additional information and the global blocks with
craft_psd::PsdFile::from_source. Channel data and the merged image stay in
the document as ranges, and the linked-file blocks are left in the source.
A damaged layer section still opens as the merged image. The local 8BPS
section, record and block walkers are removed (storytold/craft-libs#786).
* PSD: bounded zip errors, budgeted prediction row, row-bounded PackBits, channel checks before the result
A failed inflate was formatted with Debug, which prints the whole partial
output; only the status is kept. The 32-bit ZIP prediction scratch row was
allocated outside the decode budget; it is charged now. PackBits packets
were appended whole even past the row's end, growing the reserved plane;
they are cut at the row. The composite and layer decodes allocated the
document-sized result before checking that the channel data exists; the
compression and raw/RLE lengths are checked first.
* address review: check short ZIP composite data and the layer mask channel before allocating the result
* address review: drop the channel prechecks that rejected PSDs the lenient decode accepts; keep the allocation bounds
A 16384x1 output stacks every grid row onto one pixel row, so a sane warp
visits ~100x its pixels; allow each triangle about two grid cells (CodeRabbit).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The six PSD PRs merged one by one leave #1131's test calling samples()/to_rgb(), which #1139
replaced; vangel76's integration draft #1149 has the adapted version.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The 2^28 pixel limit applied per image; one composite or layer decode kept
the ZIP output, a Vec<f32> per channel and the result alive together, and the
bake size came from the file's quad. A decode now charges every buffer
against a byte budget (4 GiB, 1 GiB on 32-bit), checks its whole expected peak
before allocating, writes channels straight into the result and returns an
error when over budget. Bakes are at most 4x the document across and 2^24
pixels.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>