mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
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:
@@ -316,7 +316,7 @@ void SettingsDialog::on_EventBrowser_TimeUnit_currentIndexChanged(int index)
|
||||
if(m_Init)
|
||||
return;
|
||||
|
||||
m_Ctx.Config().EventBrowser_TimeUnit = (TimeUnit)ui->EventBrowser_TimeUnit->currentIndex();
|
||||
m_Ctx.Config().EventBrowser_TimeUnit = (TimeUnit)qMax(0, ui->EventBrowser_TimeUnit->currentIndex());
|
||||
|
||||
if(m_Ctx.HasEventBrowser())
|
||||
m_Ctx.GetEventBrowser()->UpdateDurationColumn();
|
||||
|
||||
Reference in New Issue
Block a user