#4298 Crash at generateVertexRemapMulti

master
Andrey Kleshchev 2025-06-27 17:50:58 +03:00 committed by Andrey Kleshchev
parent 4bc20a8e53
commit 9235312990
1 changed files with 9 additions and 1 deletions

View File

@ -5711,7 +5711,15 @@ bool LLVolumeFace::cacheOptimize(bool gen_tangents)
S32 vert_count = 0;
if (!data.p.empty())
{
vert_count = static_cast<S32>(meshopt_generateVertexRemapMulti(&remap[0], nullptr, data.p.size(), data.p.size(), mos, stream_count));
try
{
vert_count = static_cast<S32>(meshopt_generateVertexRemapMulti(&remap[0], nullptr, data.p.size(), data.p.size(), mos, stream_count));
}
catch (std::bad_alloc&)
{
LLError::LLUserWarningMsg::showOutOfMemory();
LL_ERRS("LLCoros") << "Failed to allocate memory for VertexRemap: " << (S32)data.p.size() << LL_ENDL;
}
}
if (vert_count < 65535 && vert_count != 0)