From e8bcad0840d84899d3c9e323dbe1efcaa4423d0b Mon Sep 17 00:00:00 2001 From: Turo Lamminen Date: Fri, 13 Feb 2015 13:17:47 +0200 Subject: [PATCH] Silence a warning and add an assertion Another false positive uninitialized variable. Actually it's only false if ToOutputVertexIndex does't return NULL which should only happen if index is out of bounds. Add assertion to make sure of that. --- code/FBXConverter.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/code/FBXConverter.cpp b/code/FBXConverter.cpp index 9ad6a2f16..7bd15736f 100644 --- a/code/FBXConverter.cpp +++ b/code/FBXConverter.cpp @@ -1256,8 +1256,11 @@ private: // taking notes so we don't need to do it twice. BOOST_FOREACH(WeightIndexArray::value_type index, indices) { - unsigned int count; + unsigned int count = 0; const unsigned int* const out_idx = geo.ToOutputVertexIndex(index, count); + // ToOutputVertexIndex only returns NULL if index is out of bounds + // which should never happen + ai_assert(out_idx != NULL); index_out_indices.push_back(no_index_sentinel); count_out_indices.push_back(0);