Add assert for code scan alert 550
This commit is contained in:
parent
63bc481b06
commit
472cb05f06
1 changed files with 5 additions and 0 deletions
|
|
@ -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 "
|
||||
|
|
|
|||
Loading…
Reference in a new issue