From 88f5da6f0464d6d057c8d505acceb35aeae7fd79 Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 15 May 2017 15:59:01 +0100 Subject: [PATCH] Protect against out-of-bounds array access --- renderdoc/driver/shaders/dxbc/dxbc_debug.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/renderdoc/driver/shaders/dxbc/dxbc_debug.cpp b/renderdoc/driver/shaders/dxbc/dxbc_debug.cpp index 5c6e763c7..aef4ab686 100644 --- a/renderdoc/driver/shaders/dxbc/dxbc_debug.cpp +++ b/renderdoc/driver/shaders/dxbc/dxbc_debug.cpp @@ -3492,7 +3492,8 @@ State State::GetNext(GlobalState &global, State quad[4]) const { const DXBC::ASMDecl &decl = dxbc->GetDeclaration(i); - if(decl.declaration == OPCODE_DCL_SAMPLER && decl.operand.indices == op.operands[3].indices) + if(decl.declaration == OPCODE_DCL_SAMPLER && op.operands.size() > 3 && + decl.operand.indices == op.operands[3].indices) { if(decl.samplerMode == SAMPLER_MODE_DEFAULT) sampler = "SamplerState s";