diff options
Diffstat (limited to 'indra/llprimitive/lldaeloader.cpp')
| -rw-r--r-- | indra/llprimitive/lldaeloader.cpp | 18 | 
1 files changed, 12 insertions, 6 deletions
diff --git a/indra/llprimitive/lldaeloader.cpp b/indra/llprimitive/lldaeloader.cpp index 4c028e7128..81ebe631c5 100644 --- a/indra/llprimitive/lldaeloader.cpp +++ b/indra/llprimitive/lldaeloader.cpp @@ -204,12 +204,15 @@ LLModel::EModelStatus load_face_from_dom_triangles(      if (idx_stride <= 0          || (pos_source && pos_offset >= idx_stride) +        || (pos_source && pos_offset < 0)          || (tc_source && tc_offset >= idx_stride) -        || (norm_source && norm_offset >= idx_stride)) +        || (tc_source && tc_offset < 0) +        || (norm_source && norm_offset >= idx_stride) +        || (norm_source && norm_offset < 0))      {          // Looks like these offsets should fit inside idx_stride          // Might be good idea to also check idx.getCount()%idx_stride != 0 -        LL_WARNS() << "Invalid pos_offset " << pos_offset <<  ", tc_offset " << tc_offset << " or norm_offset " << norm_offset << LL_ENDL; +        LL_WARNS() << "Invalid idx_stride " << idx_stride << ", pos_offset " << pos_offset <<  ", tc_offset " << tc_offset << " or norm_offset " << norm_offset << LL_ENDL;          return LLModel::BAD_ELEMENT;      } @@ -880,9 +883,10 @@ LLDAELoader::LLDAELoader(      void*               opaque_userdata,      JointTransformMap&  jointTransformMap,      JointNameSet&       jointsFromNodes, -    std::map<std::string, std::string>&     jointAliasMap, +    std::map<std::string, std::string, std::less<>>&     jointAliasMap,      U32                 maxJointsPerMesh,      U32                 modelLimit, +    U32                 debugMode,      bool                preprocess)  : LLModelLoader(          filename, @@ -895,8 +899,9 @@ LLDAELoader::LLDAELoader(          jointTransformMap,          jointsFromNodes,          jointAliasMap, -        maxJointsPerMesh), -  mGeneratedModelLimit(modelLimit), +        maxJointsPerMesh, +        modelLimit, +        debugMode),    mPreprocessDAE(preprocess)  {  } @@ -1680,6 +1685,7 @@ void LLDAELoader::processDomModel(LLModel* model, DAE* dae, daeElement* root, do          {              materials[model->mMaterialList[i]] = LLImportMaterial();          } +        // todo: likely a bug here, shouldn't be using suffixed label, see how it gets used in other places.          mScene[transformation].push_back(LLModelInstance(model, model->mLabel, transformation, materials));          stretch_extents(model, transformation);      } @@ -2412,7 +2418,7 @@ std::string LLDAELoader::getElementLabel(daeElement *element)  }  // static -size_t LLDAELoader::getSuffixPosition(std::string label) +size_t LLDAELoader::getSuffixPosition(const std::string &label)  {      if ((label.find("_LOD") != -1) || (label.find("_PHYS") != -1))      {  | 
