[4.18] Cannot build shipping game under Windows

When trying to build any game for Windows with the shipping configuration (I tested it with the Blueprint First Person Example), the build fails. Inside the UnrealBuildTool-[timestamp].log file, there is the following error:

Building UnrealHeaderTool...
Creating makefile for UnrealHeaderTool (UnrealBuildTool.exe is newer)
Target is up to date
Total build time: 1,79 seconds (NoActionsToExecute executor: 0,00 seconds)
Parsing headers for UE4Game
  Running UnrealHeaderTool UE4Game "C:\Users\denschub\Projects\UnrealEngine\Engine\Intermediate\Build\Win64\UE4Game\Shipping\UE4Game.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors
Reflection code generated for UE4Game in 29,9100361 seconds
Performing 390 actions (12 in parallel)

[...]

c:\users\denschub\projects\unrealengine\engine\source\runtime\renderer\private\postprocess\rendertargetpool.cpp(985) : error C4723: potential divide by 0

[...]

ERROR: UBT ERROR: Failed to produce item: C:\Users\denschub\Projects\UnrealEngine\Engine\Binaries\Win64\UE4Game-Win64-Shipping.exe
Total build time: 462,63 seconds (Local executor: 0,00 seconds)

Happens on both the promoted branch and on the master branch as of now.

Yea I’m also getting the same error in the same place but in 4.17. I hope this gets looked at soon. Builds fine from Editor in both DebugGame Editor and Development Editor but not in the UBT through the Command Prompt.

I got the same issue when i ■■■■ to package in Shipping mode. I’m working with the UE built from source from the release branch ( 4.17.1 at this time)

I’m getting this in 4.16.3 aswell recently

Temporary workaround

open:
c:\unrealengine\engine\source\runtime\renderer\private\postprocess\rendertargetpool.cpp

change the line to:

float ScaleX = DisplayExtent.X / ((float)MemoryStats.TotalColumnSize + 0.01f);