From 866f9ab17a893f2c10d2a4ee1797c7afb2eb12ce Mon Sep 17 00:00:00 2001
From: andreykproductengine <andreykproductengine@lindenlab.com>
Date: Wed, 17 Oct 2018 11:38:18 +0300
Subject: division by zero protection

---
 indra/newview/lllegacyatmospherics.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/lllegacyatmospherics.cpp b/indra/newview/lllegacyatmospherics.cpp
index 371bd1b7c2..b631e5498d 100644
--- a/indra/newview/lllegacyatmospherics.cpp
+++ b/indra/newview/lllegacyatmospherics.cpp
@@ -368,7 +368,7 @@ void LLAtmospherics::calcSkyColorWLVert(LLVector3 & Pn, AtmosphericsVars& vars)
 	componentMultBy(vars.hazeColor, LLColor3::white - temp1);
 
 	sunlight = vars.sunlight;
-	temp2.mV[1] = llmax(0.f, sun_norm[1] * 2.f);
+	temp2.mV[1] = llmax(F_APPROXIMATELY_ZERO, sun_norm[1] * 2.f);
 	temp2.mV[1] = 1.f / temp2.mV[1];
 	componentMultBy(sunlight, componentExp((light_atten * -1.f) * temp2.mV[1]));
 
-- 
cgit v1.2.3