Check next step is in bounds for states before checking conditions

This commit is contained in:
baldurk
2018-12-18 17:38:49 +00:00
parent 19064a0f05
commit ec6406c8ff
+2 -1
View File
@@ -1462,7 +1462,8 @@ void ShaderViewer::runTo(int runToInstruction, bool forward, ShaderEvents condit
if(runToInstruction >= 0 && m_Trace->states[step].nextInstruction == (uint32_t)runToInstruction)
break;
if(!firstStep && (m_Trace->states[step + inc].flags & condition))
if(!firstStep && (step + inc >= 0) && (step + inc < m_Trace->states.count()) &&
(m_Trace->states[step + inc].flags & condition))
break;
if(!firstStep && m_Breakpoints.contains((int)m_Trace->states[step].nextInstruction))