Skip to content

Commit

Permalink
steamcompmgr: Fix crash on refresh rate switch
Browse files Browse the repository at this point in the history
If target fps > refresh, we can crash here.
  • Loading branch information
misyltoad committed Oct 2, 2023
1 parent c707e15 commit 434ca2b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/steamcompmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7599,6 +7599,7 @@ steamcompmgr_main(int argc, char **argv)
{
int nRealRefresh = g_nNestedRefresh ? g_nNestedRefresh : g_nOutputRefresh;
int nTargetFPS = g_nSteamCompMgrTargetFPS ? g_nSteamCompMgrTargetFPS : nRealRefresh;
nTargetFPS = std::min<int>( nTargetFPS, nRealRefresh );
int nMultiplier = nRealRefresh / nTargetFPS;

int nAppRefresh = nRealRefresh * nMultiplier;
Expand Down

0 comments on commit 434ca2b

Please sign in to comment.