1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 10:42:36 +01:00

rsx: Fix stupid overflow

This commit is contained in:
kd-11 2021-09-17 19:38:04 +03:00 committed by kd-11
parent ddec5d6908
commit c2ab3c664c

View File

@ -3377,8 +3377,8 @@ namespace rsx
auto scale_result = [](u32 value) auto scale_result = [](u32 value)
{ {
const auto scale = rsx::get_resolution_scale_percent(); const auto scale = rsx::get_resolution_scale_percent();
const auto result = static_cast<u64>(value * 10000) / (scale * scale); const auto result = (value * 10000ull) / (scale * scale);
return std::max<u32>(1u, result); return std::max(1u, static_cast<u32>(result));
}; };
switch (type) switch (type)