Skip to content
This repository
Browse code

[WIN32] fixed: possible division by zero. occurred once but I wasn't …

…able to reproduce it.
  • Loading branch information...
commit 8ca5f039681da271353f936e6cb72bfd1ef5236b 1 parent c4ed280
wsoltys authored October 14, 2012
5  xbmc/visualizations/Milkdrop/vis_milkdrop/milkdropfs.cpp
@@ -1367,7 +1367,10 @@ void CPlugin::WarpedBlitFromVS0ToVS1()
1367 1367
 
1368 1368
 	// warp stuff
1369 1369
 	float fWarpTime = GetTime() * m_pState->m_fWarpAnimSpeed;
1370  
-	float fWarpScaleInv = 1.0f / m_pState->m_fWarpScale.eval(GetTime());
  1370
+  float fWarpScale = m_pState->m_fWarpScale.eval(GetTime());
  1371
+  float fWarpScaleInv = 1.0f;
  1372
+  if(fWarpScale != 0.0f)
  1373
+    float fWarpScaleInv = 1.0f / fWarpScale;
1371 1374
 	float f[4];
1372 1375
 	f[0] = 11.68f + 4.0f*cosf(fWarpTime*1.413f + 10);
1373 1376
 	f[1] =  8.77f + 3.0f*cosf(fWarpTime*1.113f + 7);

3 notes on commit 8ca5f03

arnova

You can drop the float here ;-)

wsoltys
arnova
Collaborator

@wsoltys : Not sure whether you're aware of the fact that the formatting in that file is pretty f*cked up (hard tabs vs. soft tabs)?

arnova
Collaborator

Btw. removed the float in 12524a8

wsoltys
Collaborator
Please sign in to comment.
Something went wrong with that request. Please try again.