#3627 std::bad_alloc when loading a model

master
Andrey Kleshchev 2025-04-06 15:01:28 +03:00 committed by Andrey Kleshchev
parent cc54e206c3
commit f6a2dbe6ec
3 changed files with 28 additions and 4 deletions

View File

@ -69,9 +69,16 @@ void GLTFSceneManager::load()
{
return;
}
if (filenames.size() > 0)
try
{
GLTFSceneManager::instance().load(filenames[0]);
if (filenames.size() > 0)
{
GLTFSceneManager::instance().load(filenames[0]);
}
}
catch (std::bad_alloc&)
{
LLNotificationsUtil::add("CannotOpenFileTooBig");
}
},
LLFilePicker::FFLOAD_GLTF,

View File

@ -2857,9 +2857,16 @@ void LLMaterialEditor::importMaterial()
{
return;
}
if (filenames.size() > 0)
try
{
LLMaterialEditor::loadMaterialFromFile(filenames[0], -1);
if (filenames.size() > 0)
{
LLMaterialEditor::loadMaterialFromFile(filenames[0], -1);
}
}
catch (std::bad_alloc&)
{
LLNotificationsUtil::add("CannotOpenFileTooBig");
}
},
LLFilePicker::FFLOAD_MATERIAL,

View File

@ -2408,6 +2408,16 @@ Unable to upload snapshot.
File might be too big, try reducing resolution or try again later.
<tag>fail</tag>
</notification>
<notification
icon="alertmodal.tga"
name="CannotOpenFileTooBig"
type="alertmodal">
Unable to open file.
Viewer run out of memory while opening file. File might be too big.
<tag>fail</tag>
</notification>
<notification
icon="notifytip.tga"