Protect against out-of-bounds array access

This commit is contained in:
baldurk
2017-05-15 15:59:01 +01:00
parent dda3da8e96
commit 88f5da6f04
+2 -1
View File
@@ -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";