summaryrefslogtreecommitdiff
path: root/indra/llprimitive/llmodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llprimitive/llmodel.cpp')
-rwxr-xr-xindra/llprimitive/llmodel.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp
index e236f98fe6..4d93627116 100755
--- a/indra/llprimitive/llmodel.cpp
+++ b/indra/llprimitive/llmodel.cpp
@@ -238,6 +238,11 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector<LLVolumeFace>& fa
{
// guard against model data specifiying out of range indices or norms
//
+ if (((i + pos_offset) > index_count)
+ || ((idx[i+pos_offset]*3+2) > vertex_count))
+ {
+ return LLModel::BAD_ELEMENT;
+ }
if (((i + norm_offset) > index_count)
|| ((idx[i+norm_offset]*3+2) > norm_count))
{