summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorrichard <none@none>2010-01-04 13:05:25 -0800
committerrichard <none@none>2010-01-04 13:05:25 -0800
commit02262a60ad233ff06f8d3f975a240660c317c903 (patch)
tree642a4d6516af1b217be361c4cd5dddf895bcc7b4 /indra
parent6703cbc8af55cb70410d99ae38aa739bff2e692a (diff)
EXT-3876 - Fast Timers crashes viewer
avoid divide by zero reviewed by Mani
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llfasttimerview.cpp4
1 files changed, 3 insertions, 1 deletions
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;