summaryrefslogtreecommitdiff
path: root/indra/llmath/llvolume.cpp
diff options
context:
space:
mode:
authorGraham Madarasz <graham@lindenlab.com>2013-03-06 09:09:07 -0800
committerGraham Madarasz <graham@lindenlab.com>2013-03-06 09:09:07 -0800
commit1816582b929737f92ee68a1422e3be4e7c02f542 (patch)
tree809bb12dee585f117ef97ea85976d84a4e016efa /indra/llmath/llvolume.cpp
parenteda81f68ca1b337164a94e89f42e53fe76c0e381 (diff)
Fix crashes from using single alloc for pos/norm/tc in volume face data fighting with old free call in model loading code
Diffstat (limited to 'indra/llmath/llvolume.cpp')
-rw-r--r--indra/llmath/llvolume.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index f989e8ed17..f503eea107 100644
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -5307,7 +5307,7 @@ LLVolumeFace::~LLVolumeFace()
void LLVolumeFace::freeData()
{
- ll_aligned_free_16(mPositions);
+ ll_aligned_free(mPositions);
mPositions = NULL;
//normals and texture coordinates are part of the same buffer as mPositions, do not free them separately
@@ -5492,10 +5492,11 @@ void LLVolumeFace::optimize(F32 angle_cutoff)
}
}
- llassert(new_face.mNumIndices == mNumIndices);
- llassert(new_face.mNumVertices <= mNumVertices);
-
- swapData(new_face);
+ if (new_face.mNumVertices)
+ {
+ llassert(new_face.mNumIndices == mNumIndices);
+ swapData(new_face);
+ }
}
class LLVCacheTriangleData;