#3285 Crash at remapIndexBuffer

meow-7.2.2
Andrey Kleshchev 2024-12-13 19:15:53 +02:00 committed by Andrey Kleshchev
parent 16afa19b90
commit 5d64e64458
1 changed files with 4 additions and 1 deletions

View File

@ -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,