From 8f960f0ed2ea073017e8f8672f3575c8de273a29 Mon Sep 17 00:00:00 2001 From: Gargaj Date: Tue, 5 Aug 2014 19:36:18 +0200 Subject: [PATCH] avoid division by zero --- include/assimp/ProgressHandler.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/assimp/ProgressHandler.hpp b/include/assimp/ProgressHandler.hpp index 8aaa99276..3ab1e489b 100644 --- a/include/assimp/ProgressHandler.hpp +++ b/include/assimp/ProgressHandler.hpp @@ -97,7 +97,7 @@ public: * of the file parsing. * */ virtual void UpdateFileRead(int currentStep /*= 0*/, int numberOfSteps /*= 0*/) { - float f = currentStep / (float)numberOfSteps; + float f = numberOfSteps ? currentStep / (float)numberOfSteps : 1.0f; Update( f * 0.5f ); }; @@ -111,7 +111,7 @@ public: * increasing, although not necessarily linearly. * */ virtual void UpdatePostProcess(int currentStep /*= 0*/, int numberOfSteps /*= 0*/) { - float f = currentStep / (float)numberOfSteps; + float f = numberOfSteps ? currentStep / (float)numberOfSteps : 1.0f; Update( f * 0.5f + 0.5f ); };