summaryrefslogtreecommitdiff
path: root/indra/llmath/llvolume.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2022-04-18 20:39:47 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2022-04-18 20:39:47 +0300
commita0ec6fd37143dd78ee2531e12ff17c7d2ee935dd (patch)
tree3d0c87eb893744880b5d456bc7e9cc892fd30af4 /indra/llmath/llvolume.cpp
parentbbdbd6c2dd79adc4749e24c88c9f04755a4b12a1 (diff)
parentd031662435d97101411ae990ed85d6e001ab668a (diff)
Merge branch 'master' into DRTVWR-486
Diffstat (limited to 'indra/llmath/llvolume.cpp')
-rw-r--r--indra/llmath/llvolume.cpp31
1 files changed, 28 insertions, 3 deletions
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index 13b65dfaa0..411d76adb2 100644
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -5745,7 +5745,16 @@ BOOL LLVolumeFace::createUnCutCubeCap(LLVolume* volume, BOOL partial_build)
resizeIndices(grid_size*grid_size*6);
if (!volume->isMeshAssetLoaded())
{
- mEdge.resize(grid_size*grid_size * 6);
+ S32 size = grid_size * grid_size * 6;
+ try
+ {
+ mEdge.resize(size);
+ }
+ catch (std::bad_alloc&)
+ {
+ LL_WARNS("LLVOLUME") << "Resize of mEdge to " << size << " failed" << LL_ENDL;
+ return false;
+ }
}
U16* out = mIndices;
@@ -6554,7 +6563,15 @@ BOOL LLVolumeFace::createSide(LLVolume* volume, BOOL partial_build)
if (!volume->isMeshAssetLoaded())
{
- mEdge.resize(num_indices);
+ try
+ {
+ mEdge.resize(num_indices);
+ }
+ catch (std::bad_alloc&)
+ {
+ LL_WARNS("LLVOLUME") << "Resize of mEdge to " << num_indices << " failed" << LL_ENDL;
+ return false;
+ }
}
}
@@ -6782,7 +6799,15 @@ BOOL LLVolumeFace::createSide(LLVolume* volume, BOOL partial_build)
LLVector4a* norm = mNormals;
static LLAlignedArray<LLVector4a, 64> triangle_normals;
- triangle_normals.resize(count);
+ try
+ {
+ triangle_normals.resize(count);
+ }
+ catch (std::bad_alloc&)
+ {
+ LL_WARNS("LLVOLUME") << "Resize of triangle_normals to " << count << " failed" << LL_ENDL;
+ return false;
+ }
LLVector4a* output = triangle_normals.mArray;
LLVector4a* end_output = output+count;