diff options
author | Graham Linden <none@none> | 2014-09-25 10:40:40 -0700 |
---|---|---|
committer | Graham Linden <none@none> | 2014-09-25 10:40:40 -0700 |
commit | 8f8055996d18b030195b6fc617aef948aae11ba7 (patch) | |
tree | 96b35c36a32f1055b6d6a4e701dd999ce713ef9b /indra/newview/llfloatermodelpreview.cpp | |
parent | 9f4788d7a8a924de654d55bfb102a81f797a9cf9 (diff) |
Maint 4470 fix material subset crash in the face of bogus content
Diffstat (limited to 'indra/newview/llfloatermodelpreview.cpp')
-rwxr-xr-x | indra/newview/llfloatermodelpreview.cpp | 40 |
1 files changed, 25 insertions, 15 deletions
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index cfe2ea0307..3aa191cf51 100755 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -1533,19 +1533,25 @@ void LLModelPreview::rebuildUploadData() } LLModel* high_lod_model = instance.mLOD[LLModel::LOD_HIGH]; - llassert(high_lod_model); - - for (U32 i = 0; i < LLModel::NUM_LODS-1; i++) - { - int refFaceCnt = 0; - int modelFaceCnt = 0; - llassert(instance.mLOD[i]); - if (instance.mLOD[i] && !instance.mLOD[i]->matchMaterialOrder(high_lod_model, refFaceCnt, modelFaceCnt ) ) - { - setLoadState( LLModelLoader::ERROR_MATERIALS ); - mFMP->childDisable( "calculate_btn" ); - } - } + if (!high_lod_model) + { + setLoadState( LLModelLoader::ERROR_MATERIALS ); + mFMP->childDisable( "calculate_btn" ); + } + else + { + for (U32 i = 0; i < LLModel::NUM_LODS-1; i++) + { + int refFaceCnt = 0; + int modelFaceCnt = 0; + llassert(instance.mLOD[i]); + if (instance.mLOD[i] && !instance.mLOD[i]->matchMaterialOrder(high_lod_model, refFaceCnt, modelFaceCnt ) ) + { + setLoadState( LLModelLoader::ERROR_MATERIALS ); + mFMP->childDisable( "calculate_btn" ); + } + } + } instance.mTransform = mat; mUploadData.push_back(instance); } @@ -2402,12 +2408,16 @@ void LLModelPreview::updateStatusMessages() LLModelInstance& instance = *iter; LLModel* model_high_lod = instance.mLOD[LLModel::LOD_HIGH]; - llassert(model_high_lod); + if (!model_high_lod) + { + setLoadState( LLModelLoader::ERROR_MATERIALS ); + mFMP->childDisable( "calculate_btn" ); + continue; + } for (U32 i = 0; i < LLModel::NUM_LODS-1; i++) { LLModel* lod_model = instance.mLOD[i]; - llassert(lod_model); if (!lod_model) { setLoadState( LLModelLoader::ERROR_MATERIALS ); |