From ced1b326dfe56349b6c2a370e294c890e409502b Mon Sep 17 00:00:00 2001 From: PancakeTAS Date: Mon, 7 Jul 2025 03:15:47 +0200 Subject: [PATCH] fix: sneaky underflow when multiplier is zero fixes #22 --- src/hooks.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hooks.cpp b/src/hooks.cpp index a640f87..81dceaa 100644 --- a/src/hooks.cpp +++ b/src/hooks.cpp @@ -93,8 +93,8 @@ namespace { reinterpret_cast(*pDevice)); try { const char* frameGenEnv = std::getenv("LSFG_MULTIPLIER"); - const uint64_t frameGen = std::max(1, - std::stoul(frameGenEnv ? frameGenEnv : "2") - 1); + const uint64_t frameGen = static_cast( + std::max(1, std::stol(frameGenEnv ? frameGenEnv : "2") - 1)); Log::debug("hooks", "Using {}x frame generation", frameGen + 1);