Add assert for code scan alert 550

This commit is contained in:
Nick Bolton 2024-07-29 23:42:30 +01:00
parent 63bc481b06
commit 472cb05f06

View File

@ -30,6 +30,11 @@ ScreenSetupModel::ScreenSetupModel(
m_Screens(screens),
m_NumColumns(numColumns),
m_NumRows(numRows) {
// bound rows and columns to prevent multiply overflow.
// this is unlikely to happen, as the grid size is only 3x9.
assert(m_NumColumns < 100 && m_NumRows < 100);
if (m_NumColumns * m_NumRows > screens.size())
qFatal(
"Not enough elements (%lld) in screens QList for %d columns and %d "