summaryrefslogtreecommitdiff
path: root/indra/llprimitive/lldaeloader.cpp
diff options
context:
space:
mode:
authorMnikolenko ProductEngine <mnikolenko@productengine.com>2015-02-09 12:17:44 +0200
committerMnikolenko ProductEngine <mnikolenko@productengine.com>2015-02-09 12:17:44 +0200
commit46101abd7348cdf386f58321c9e372b0c56983fd (patch)
tree1d223b1a60c9b568e792a29267e1e2ab48a251da /indra/llprimitive/lldaeloader.cpp
parentcf5a5a0e9727cbcc8ea9dd8d0ea25d5ba03c93e7 (diff)
MAINT-4863 FIXED Return LLModel::BAD_ELEMENT for model with empty or corrupted position array
Diffstat (limited to 'indra/llprimitive/lldaeloader.cpp')
-rw-r--r--indra/llprimitive/lldaeloader.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/indra/llprimitive/lldaeloader.cpp b/indra/llprimitive/lldaeloader.cpp
index 72de651eea..355826b428 100644
--- a/indra/llprimitive/lldaeloader.cpp
+++ b/indra/llprimitive/lldaeloader.cpp
@@ -169,6 +169,11 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector<LLVolumeFace>& fa
if (pos_source)
{
+ if(!pos_source->getFloat_array() || (v.getCount() == 0))
+ {
+ return LLModel::BAD_ELEMENT;
+ }
+
face.mExtents[0].set(v[0], v[1], v[2]);
face.mExtents[1].set(v[0], v[1], v[2]);
}
@@ -2202,7 +2207,7 @@ bool LLDAELoader::addVolumeFacesFromDomMesh(LLModel* pModel,domMesh* mesh)
domTrianglesRef& tri = tris.get(i);
status = load_face_from_dom_triangles(pModel->getVolumeFaces(), pModel->getMaterialList(), tri);
-
+ pModel->mStatus = status;
if(status != LLModel::NO_ERRORS)
{
pModel->ClearFacesAndMaterials();