From 02262a60ad233ff06f8d3f975a240660c317c903 Mon Sep 17 00:00:00 2001
From: richard <none@none>
Date: Mon, 4 Jan 2010 13:05:25 -0800
Subject: EXT-3876 - Fast Timers crashes viewer avoid divide by zero

reviewed by Mani
---
 indra/newview/llfasttimerview.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp
index effa57b1ef..7d8bb6e104 100644
--- a/indra/newview/llfasttimerview.cpp
+++ b/indra/newview/llfasttimerview.cpp
@@ -323,7 +323,9 @@ void LLFastTimerView::draw()
 	S32 xleft = margin;
 	S32 ytop = margin;
 	
-	mAverageCyclesPerTimer = llround(lerp((F32)mAverageCyclesPerTimer, (F32)(LLFastTimer::sTimerCycles / (U64)LLFastTimer::sTimerCalls), 0.1f));
+	mAverageCyclesPerTimer = LLFastTimer::sTimerCalls == 0 
+		? 0 
+		: llround(lerp((F32)mAverageCyclesPerTimer, (F32)(LLFastTimer::sTimerCycles / (U64)LLFastTimer::sTimerCalls), 0.1f));
 	LLFastTimer::sTimerCycles = 0;
 	LLFastTimer::sTimerCalls = 0;
 
-- 
cgit v1.2.3