From d35a8fcb3fca2b080a029bd261894c3ba0fdb6f5 Mon Sep 17 00:00:00 2001
From: ruslantproductengine <ruslantproductengine@lindenlab.com>
Date: Tue, 22 May 2018 18:18:57 +0300
Subject: [PATCH] MAINT-8670 Crash in: LLFace::getGeometryVolume() Guarded.

---
 indra/newview/llface.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp
index 50a4925c37f..474645c084a 100644
--- a/indra/newview/llface.cpp
+++ b/indra/newview/llface.cpp
@@ -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;
-- 
GitLab