This bug is in code lifted from OSG rather than code I've written. It might just be that it occasionally breaks when fed -DBL_MAX, but I don't anticipate that a solution will be too hard to create.
How on earth could the guts of the shadow code be content development? You're smarter than that, Thunderforge.Would it be better to move this conversation to the Content Development Section? Or is it related somehow to OpenMW development?