Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
Qt Creator 4.4.0-rc1
-
None
Description
In the function ServerModeReader::handleProgress, on line 420:
int progress = m_progressStepMinimum
+ (((max - min) / (cur - min)) * (m_progressStepMaximum - m_progressStepMinimum));
we can have a division by zero when cur == min, this has happend to me when loading a very big cmake project. In addition the formula looks wrong to calculate the progress, looks to me it should be (perhaps using float instead):
int progress = m_progressStepMinimum + ((cur - min) / (max - min)) * (m_progressStepMaximum - m_progressStepMinimum));