Fix potential lod bug in mdodel decode.

This commit is contained in:
Shyotl
2019-04-03 13:55:41 -05:00
parent 3a031e9364
commit ac2d16b15c

View File

@@ -1132,9 +1132,7 @@ bool LLModel::loadModel(std::istream& is)
"physics_mesh",
}};
const S32 MODEL_LODS = lod_name.size();
S32 lod = llclamp((S32) mDetail, 0, MODEL_LODS);
S32 lod = llclamp((S32) mDetail, 0, (S32)lod_name.size() - 1);
if (header[lod_name[lod]]["offset"].asInteger() == -1 ||
header[lod_name[lod]]["size"].asInteger() == 0 )