diff options
Diffstat (limited to 'indra/llmath')
-rw-r--r-- | indra/llmath/llvolume.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 700e61467b..44b6e7923b 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -5159,7 +5159,10 @@ bool LLVolumeFace::VertexMapData::ComparePosition::operator()(const LLVector3& a void LLVolumeFace::remap() { // Generate a remap buffer - std::vector<unsigned int> remap(mNumVertices); + // Documentation for meshopt_generateVertexRemapMulti claims that remap should use vertice count + // but all examples use indice count. There are out of bounds crashes when using vertice count. + // To be on the safe side use bigger of the two. + std::vector<unsigned int> remap(llmax(mNumIndices, mNumVertices)); S32 remap_vertices_count = static_cast<S32>(LLMeshOptimizer::generateRemapMultiU16(&remap[0], mIndices, mNumIndices, |