fix: sneaky underflow when multiplier is zero

fixes #22
This commit is contained in:
PancakeTAS 2025-07-07 03:15:47 +02:00
parent 77a8c5bbfc
commit ced1b326df
No known key found for this signature in database

View file

@ -93,8 +93,8 @@ namespace {
reinterpret_cast<uintptr_t>(*pDevice));
try {
const char* frameGenEnv = std::getenv("LSFG_MULTIPLIER");
const uint64_t frameGen = std::max<uint64_t>(1,
std::stoul(frameGenEnv ? frameGenEnv : "2") - 1);
const uint64_t frameGen = static_cast<uint64_t>(
std::max<int64_t>(1, std::stol(frameGenEnv ? frameGenEnv : "2") - 1));
Log::debug("hooks", "Using {}x frame generation",
frameGen + 1);