Merged in ruslantproductengine/viewer-neko-4cr-4 (pull request #607)

MAINT-8670 Crash in: LLFace::getGeometryVolume()

Approved-by: Andrey Lihatskiy <andreylproductengine@lindenlab.com>
Approved-by: Andrey Kleshchev <andreykproductengine@lindenlab.com>
Approved-by: Simon Linden <simon@lindenlab.com>
meow-7.2.2
Ruslan Teliuk 2018-05-22 15:22:17 +00:00
commit 32b07b5a6f
1 changed files with 6 additions and 0 deletions

View File

@ -1217,6 +1217,12 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
{
LL_RECORD_BLOCK_TIME(FTM_FACE_GET_GEOM);
llassert(verify());
if (volume.getNumVolumeFaces() <= f) {
LL_WARNS() << "Attempt get volume face out of range! Total Faces: " << volume.getNumVolumeFaces() << " Attempt get access to: " << f << LL_ENDL;
return FALSE;
}
const LLVolumeFace &vf = volume.getVolumeFace(f);
S32 num_vertices = (S32)vf.mNumVertices;
S32 num_indices = (S32) vf.mNumIndices;