Refactor out-of-bounds check to handle negative (~0U in uint) idxs

This commit is contained in:
baldurk
2017-05-10 10:24:58 +01:00
parent 4fb8b22b2d
commit 657def5fb2
+1 -1
View File
@@ -962,7 +962,7 @@ ShaderVariable State::GetSrc(const ASMOperand &oper, const ASMOperation &op) con
v = s = ShaderVariable("", 0, 0, 0, 0);
// if this Vec4f is entirely in the ICB
if(indices[0] * 4 + 4 <= dxbc->m_Immediate.size())
if(indices[0] <= dxbc->m_Immediate.size() / 4 - 1)
{
memcpy(s.value.uv, &dxbc->m_Immediate[indices[0] * 4], sizeof(Vec4f));
}