From 4941a3d81ce58e4e69df99b688cd484f0b891df4 Mon Sep 17 00:00:00 2001 From: Kitchen Date: Mon, 22 Jul 2019 11:45:37 +0800 Subject: [PATCH] fix devide by zero in texture viewer when construct orientation matrix (#1825) --- tools/texturev/texturev.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/texturev/texturev.cpp b/tools/texturev/texturev.cpp index 045f72e10..914835e9d 100644 --- a/tools/texturev/texturev.cpp +++ b/tools/texturev/texturev.cpp @@ -1095,7 +1095,7 @@ struct InterpolatorT const double freq = double(bx::getHPFrequency() ); int64_t now = bx::getHPCounter(); float time = (float)(double(now - offset) / freq); - float lerp = bx::clamp(time, 0.0f, duration) / duration; + float lerp = duration != 0 ? bx::clamp(time, 0.0f, duration) / duration : 0.0f; return lerpT(from, to, easeT(lerp) ); }