fix(xgameruntime): reject non-finite HDR luminance values in hdr::normalize #374
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/374"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from LooperSalty/AnyXboxX. Originally posted by Lewandox on 2026-11-26T13:44:18Z.
Summary
Fixes
hdr::normalizeincrates/anyxboxx-xgameruntime/src/hdr.rsallowingf32::INFINITYthrough asmax_tone_map_luminance(andmax_full_frame_tone_map_luminance).Previously,
normalizecheckedmin.is_nan() || max.is_nan() || min < 0.0 || max <= min, so a reported(0.01, +inf, 400.0)bypassed all checks and returnedmax_tone_map_luminance = +infto the title's tone mapper. Similarly,full_frame == +infbypassed the fallback check.Changes
crates/anyxboxx-xgameruntime/src/hdr.rs: Use!is_finite()instead ofis_nan()formin,max, andfull_frame.f32::INFINITYandf32::NEG_INFINITYacrossmin,max, andmax_full_frame_tone_map_luminance.Verification
cargo fmt -p anyxboxx-xgameruntime -- --check— passcargo clippy -p anyxboxx-xgameruntime --no-deps --all-targets -- -D warnings— passcargo test -p anyxboxx-xgameruntime hdr::tests— all passed, 0 failed