From ec6406c8ffbb6be5e6dcaeede9e785afbc22f77d Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 18 Dec 2018 17:38:49 +0000 Subject: [PATCH] Check next step is in bounds for states before checking conditions --- qrenderdoc/Windows/ShaderViewer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qrenderdoc/Windows/ShaderViewer.cpp b/qrenderdoc/Windows/ShaderViewer.cpp index 2565251f0..6e5468633 100644 --- a/qrenderdoc/Windows/ShaderViewer.cpp +++ b/qrenderdoc/Windows/ShaderViewer.cpp @@ -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))