0025164: BVH_Box::Area() might be called on uninitialized data
authordbp <dbp@opencascade.com>
Mon, 15 Sep 2014 14:08:03 +0000 (18:08 +0400)
committerbugmaster <bugmaster@opencascade.com>
Thu, 25 Sep 2014 11:58:09 +0000 (15:58 +0400)
src/BVH/BVH_Box.lxx

index 7affa94..8009881 100644 (file)
@@ -199,7 +199,8 @@ namespace BVHTools
 template<class T, int N>
 T BVH_Box<T, N>::Area() const
 {
 template<class T, int N>
 T BVH_Box<T, N>::Area() const
 {
-  return BVHTools::SurfaceCalculator<T, N>::Area (myMaxPoint - myMinPoint);
+  return !myInitialized ? static_cast<T> (0.0) :
+    BVHTools::SurfaceCalculator<T, N>::Area (myMaxPoint - myMinPoint);
 }
 
 // =======================================================================
 }
 
 // =======================================================================