From 47edff3d5bcfdbfd97d8aefb2d14020ff48dee68 Mon Sep 17 00:00:00 2001 From: baldurk Date: Sun, 5 Oct 2014 18:44:50 +0100 Subject: [PATCH] [Refs #87: Static Analysis] Ensure indices are initialised --- renderdoc/driver/d3d11/d3d11_context_wrap.cpp | 2 +- renderdoc/driver/d3d11/shaders/dxbc_debug.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/renderdoc/driver/d3d11/d3d11_context_wrap.cpp b/renderdoc/driver/d3d11/d3d11_context_wrap.cpp index 38af3c6be..fe1e6225b 100644 --- a/renderdoc/driver/d3d11/d3d11_context_wrap.cpp +++ b/renderdoc/driver/d3d11/d3d11_context_wrap.cpp @@ -1937,7 +1937,7 @@ void WrappedID3D11DeviceContext::SOSetTargets(UINT NumBuffers, ID3D11Buffer *con m_CurrentPipelineState->ChangeRefWrite(m_CurrentPipelineState->SO.Buffers, ppSOTargets, 0, NumBuffers); m_CurrentPipelineState->Change(m_CurrentPipelineState->SO.Offsets, pOffsets, 0, NumBuffers); - ID3D11Buffer *bufs[D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT]; + ID3D11Buffer *bufs[D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT] = {0}; for(UINT i=0; i < NumBuffers; i++) { // technically this isn't dirty until the draw call, but let's be conservative diff --git a/renderdoc/driver/d3d11/shaders/dxbc_debug.cpp b/renderdoc/driver/d3d11/shaders/dxbc_debug.cpp index a1ab08470..5d7a5a00a 100644 --- a/renderdoc/driver/d3d11/shaders/dxbc_debug.cpp +++ b/renderdoc/driver/d3d11/shaders/dxbc_debug.cpp @@ -601,7 +601,7 @@ void State::SetDst(const ASMOperand &dstoper, const ASMOperation &op, const Shad { ShaderVariable *v = NULL; - uint32_t indices[4]; + uint32_t indices[4] = {0}; RDCASSERT(dstoper.indices.size() <= 4); @@ -778,7 +778,7 @@ ShaderVariable State::GetSrc(const ASMOperand &oper, const ASMOperation &op) con { ShaderVariable v, s; - uint32_t indices[4]; + uint32_t indices[4] = {0}; RDCASSERT(oper.indices.size() <= 4);