CTM: check for finite value aswell (#11185)

checking for < 0.F will not catch NaN or inf values, use std::isfinite
aswell.
This commit is contained in:
Tom Englund
2025-07-23 12:09:19 +02:00
committed by GitHub
parent fdbbad04bb
commit 6ca7c14b58

View File

@@ -34,8 +34,8 @@ CHyprlandCTMControlResource::CHyprlandCTMControlResource(UP<CHyprlandCtmControlM
wl_fixed_to_double(mat5), wl_fixed_to_double(mat6), wl_fixed_to_double(mat7), wl_fixed_to_double(mat8)};
for (auto& el : MAT) {
if (el < 0.F) {
m_resource->error(HYPRLAND_CTM_CONTROL_MANAGER_V1_ERROR_INVALID_MATRIX, "a matrix component was < 0");
if (!std::isfinite(el) || el < 0.F) {
m_resource->error(HYPRLAND_CTM_CONTROL_MANAGER_V1_ERROR_INVALID_MATRIX, "a matrix component was invalid");
return;
}
}