From 2d9e00eff5ca1e526351e77800dc3abdf4ff9b68 Mon Sep 17 00:00:00 2001 From: Henri Beauchamp Date: Mon, 29 Jan 2024 19:42:19 +0100 Subject: 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 --- indra/newview/llreflectionmapmanager.cpp | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'indra/newview') 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& 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) -- cgit v1.2.3