summaryrefslogtreecommitdiff
path: root/indra/llmath
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2022-04-18 23:42:39 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2022-04-18 23:42:39 +0300
commitce4c694b66b1e4ed479e5143b10616a76f2da18b (patch)
treeac4bd223fae0764c2c86e34283871f8cfafdafd8 /indra/llmath
parente33f23f58a2caa561dfe4b3b114786f40983d136 (diff)
parentd031662435d97101411ae990ed85d6e001ab668a (diff)
Merge branch master (D540) into DRTVWR-546
# Conflicts: # indra/llcommon/llsdutil.cpp # indra/newview/VIEWER_VERSION.txt # indra/newview/lldrawpoolalpha.cpp # indra/newview/lldrawpoolwater.cpp
Diffstat (limited to 'indra/llmath')
-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 efa1a4076b..3727ce85af 100644
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -5764,7 +5764,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;
@@ -6577,7 +6586,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;
+ }
}
}
@@ -6805,7 +6822,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;