Skip to content

Commit 6ca7c14

Browse files
authored
CTM: check for finite value aswell (#11185)
checking for < 0.F will not catch NaN or inf values, use std::isfinite aswell.
1 parent fdbbad0 commit 6ca7c14

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/protocols/CTMControl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ CHyprlandCTMControlResource::CHyprlandCTMControlResource(UP<CHyprlandCtmControlM
3434
wl_fixed_to_double(mat5), wl_fixed_to_double(mat6), wl_fixed_to_double(mat7), wl_fixed_to_double(mat8)};
3535

3636
for (auto& el : MAT) {
37-
if (el < 0.F) {
38-
m_resource->error(HYPRLAND_CTM_CONTROL_MANAGER_V1_ERROR_INVALID_MATRIX, "a matrix component was < 0");
37+
if (!std::isfinite(el) || el < 0.F) {
38+
m_resource->error(HYPRLAND_CTM_CONTROL_MANAGER_V1_ERROR_INVALID_MATRIX, "a matrix component was invalid");
3939
return;
4040
}
4141
}

0 commit comments

Comments
 (0)