mirror of
https://github.com/storytold/effectcraft.git
synced 2026-11-25 03:52:00 +01:00
mask_image read /BitsPerComponent from the attacker-controlled /SMask dict with no validation and fed it straight into 1u32 << bpc — the main image path rejects anything but 1|2|4|8|16 before its own identical shift, the mask path did not. /BitsPerComponent 32 panics in debug and test builds and wraps the shift in release, mistranslating every sample into alpha. Mirror decode()'s depth check: an unsupported mask depth means no usable mask, so the image draws with the mask treated as absent. Regression test: smask_with_absurd_bpc_is_ignored_not_fatal — panics at crates/pdf/src/image.rs:184 on main, passes with the check.