summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/VertexLoaderBase.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2015-07-07 18:12:14 -0400
committerLioncash <mathew1800@gmail.com>2015-07-07 18:33:58 -0400
commitdf379dabae6cd214aa56c1fecdb55133249a1847 (patch)
tree2cb85c753152ff6e2b3a47aa707f80a4a3c6c5ee /Source/Core/VideoCommon/VertexLoaderBase.cpp
parentc54534ee3ba6c9f7de066b9de3588c533f91a5c4 (diff)
VertexLoaderBase: Adjust the scope of a boolean variable
if a or b do actually turn out to be null, this can cause a null pointer dereference.
Diffstat (limited to 'Source/Core/VideoCommon/VertexLoaderBase.cpp')
-rw-r--r--Source/Core/VideoCommon/VertexLoaderBase.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/Source/Core/VideoCommon/VertexLoaderBase.cpp b/Source/Core/VideoCommon/VertexLoaderBase.cpp
index d5831bc8e5..7f8134b85b 100644
--- a/Source/Core/VideoCommon/VertexLoaderBase.cpp
+++ b/Source/Core/VideoCommon/VertexLoaderBase.cpp
@@ -131,13 +131,14 @@ public:
: VertexLoaderBase(vtx_desc, vtx_attr), a(_a), b(_b)
{
m_initialized = a && b && a->IsInitialized() && b->IsInitialized();
- bool can_test = a->m_VertexSize == b->m_VertexSize &&
- a->m_native_components == b->m_native_components &&
- a->m_native_vtx_decl.stride == b->m_native_vtx_decl.stride;
if (m_initialized)
{
- if (can_test)
+ m_initialized = a->m_VertexSize == b->m_VertexSize &&
+ a->m_native_components == b->m_native_components &&
+ a->m_native_vtx_decl.stride == b->m_native_vtx_decl.stride;
+
+ if (m_initialized)
{
m_VertexSize = a->m_VertexSize;
m_native_components = a->m_native_components;
@@ -152,8 +153,6 @@ public:
b->m_VertexSize, b->m_native_components, b->m_native_vtx_decl.stride);
}
}
-
- m_initialized &= can_test;
}
~VertexLoaderTester() override
{