Clamp currentIndex from Qt which can come back as -1 in some cases

* If this gets propagated far enough and used as an index it can cause
  crashes, so we clamp to 0 when we know the value should be
  non-negative.
This commit is contained in:
baldurk
2017-10-24 12:56:31 +01:00
parent 5e6ff6a276
commit 1e41875479
5 changed files with 20 additions and 20 deletions
+1 -1
View File
@@ -3207,7 +3207,7 @@ void BufferViewer::on_solidShading_currentIndexChanged(int index)
m_Config.wireframeDraw = true;
}
m_Config.solidShadeMode = (SolidShade)index;
m_Config.solidShadeMode = (SolidShade)qMax(0, index);
m_ModelVSIn->setSecondaryColumn(m_ModelVSIn->secondaryColumn(),
m_Config.solidShadeMode == SolidShade::Secondary,