From 234273d9b86cfd447b73732efd36698d092d2c0f Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Mon, 16 Nov 2026 07:44:53 +0100 Subject: [PATCH] docs(exr): note the shared decoder's all-channel data-window bound --- crates/media/src/exr_channels.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/media/src/exr_channels.rs b/crates/media/src/exr_channels.rs index 13e3c9d93..3463cf663 100644 --- a/crates/media/src/exr_channels.rs +++ b/crates/media/src/exr_channels.rs @@ -112,7 +112,10 @@ fn decode(bytes: &[u8], keep: &dyn Fn(&str) -> bool) -> Result limits.max_pixels = MAX_DISPLAY_PIXELS as u64; limits.max_bytes = MAX_DECODE_BYTES as u64; // Header-only checks must not charge channels this caller does not decode. The shared display - // decoder independently checks the exact selected display planes before allocating them. + // decoder independently checks the exact selected display planes before allocating them. It + // also bounds a selected part's data window across all of its channels (decoded blocks carry + // every channel before the unused ones are dropped), so a part whose full channel set exceeds + // `max_bytes` is refused even when the kept planes alone would fit. let mut header_limits = limits; header_limits.max_width = u32::MAX; header_limits.max_height = u32::MAX;