[osg-users] division by zero in osgParticle/FluidProgram.cpp

Csaba Halász csaba.halasz at gmail.com
Thu Mar 12 09:02:41 PDT 2009


On Thu, Mar 5, 2009 at 4:16 AM, Csaba Halász <csaba.halasz at gmail.com> wrote:
> Hi!
>
> If wind_accel has zero length, then line 43
>
>  double critical_dt2 = relative_wind.length2()/wind_accel.length2();
>
> will attempt a divide by zero. A simple fix would be to check for zero
> but that would still leave the possibility of an overflow if the
> divisor is small. So a more clever check would be nice. Any
> suggestions?

Sorry for the "UP", but with a planned 2.8.1 bugfix release, I wonder
if at least the trivial fix for this could be applied, if nobody has a
better idea.
Same goes for the other div-by-zero I reported.

-- 
Csaba/Jester



More information about the osg-users mailing list