mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-08 19:42:12 +00:00
When the entropy stream ends before the frame does, the stream-end rule gives the remaining samples their predictor values. That was silent: a raw-data record cut short inside an intact CIFF heap decoded as a smeared image instead of an error. `decode` now counts those samples (`Image::stream_end_fill`) and returns `Error::Corrupt` when there are more than `Limits::max_stream_end_fill` (default 64, one block). `Limits` is non-exhaustive, so the field is additive. The frozen format is unchanged: a fill within the limit decodes exactly as before. Every real file measured fills none: 1,318 files of all seven verified bodies (1,308 EOS D60), whose last samples come from an end-of-block code. The CC0 sample test still decodes all ten files exactly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>