diff options
author | Henri Beauchamp <sldev@free.fr> | 2024-01-29 19:42:19 +0100 |
---|---|---|
committer | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2024-02-08 22:47:50 +0200 |
commit | 2d9e00eff5ca1e526351e77800dc3abdf4ff9b68 (patch) | |
tree | ca4a51915443101c22f7aa4e65b51562b2d6bcaa /indra/newview/llreflectionmapmanager.cpp | |
parent | 9d3f04042430cb73b3c095091a4d3694d4489948 (diff) |
Fix for a potential crash in LLReflectionMapManager::registerSpatialGroup()
The spatial partion could potentially be NULL and shall therefore been tested for this case.
Similar fix to https://github.com/secondlife/viewer/commit/08cf926d3b6eb28e0b9751ba62b1ce01230a150b
Diffstat (limited to 'indra/newview/llreflectionmapmanager.cpp')
-rw-r--r-- | indra/newview/llreflectionmapmanager.cpp | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/indra/newview/llreflectionmapmanager.cpp b/indra/newview/llreflectionmapmanager.cpp index 69674417c1..aa905bf2f8 100644 --- a/indra/newview/llreflectionmapmanager.cpp +++ b/indra/newview/llreflectionmapmanager.cpp @@ -463,17 +463,22 @@ void LLReflectionMapManager::getReflectionMaps(std::vector<LLReflectionMap*>& ma LLReflectionMap* LLReflectionMapManager::registerSpatialGroup(LLSpatialGroup* group) { - if (group->getSpatialPartition()->mPartitionType == LLViewerRegion::PARTITION_VOLUME) + if (!group) { - OctreeNode* node = group->getOctreeNode(); - F32 size = node->getSize().getF32ptr()[0]; - if (size >= 15.f && size <= 17.f) - { - return addProbe(group); - } + return nullptr; } - - return nullptr; + LLSpatialPartition* part = group->getSpatialPartition(); + if (!part || part->mPartitionType != LLViewerRegion::PARTITION_VOLUME) + { + return nullptr; + } + OctreeNode* node = group->getOctreeNode(); + F32 size = node->getSize().getF32ptr()[0]; + if (size < 15.f || size > 17.f) + { + return nullptr; + } + return addProbe(group); } LLReflectionMap* LLReflectionMapManager::registerViewerObject(LLViewerObject* vobj) |