diff --git a/features/include/pcl/features/impl/crh.hpp b/features/include/pcl/features/impl/crh.hpp index 8af466cc549..d435e4b2f7b 100644 --- a/features/include/pcl/features/impl/crh.hpp +++ b/features/include/pcl/features/impl/crh.hpp @@ -94,8 +94,11 @@ pcl::CRHEstimation::computeFeature (PointCloudOut pcl::transformPointCloudWithNormals (grid, grid, transformPC); - //fill spatial data vector - kiss_fft_scalar * spatial_data = new kiss_fft_scalar[nbins]; + //fill spatial data vector and the zero-initialize or "value-initialize" an array on c++, + // the initialization is made with () after the [nbins] + kiss_fft_scalar * spatial_data = new kiss_fft_scalar[nbins](); + + float sum_w = 0, w = 0; int bin = 0; for (size_t i = 0; i < grid.points.size (); ++i)