diff --git a/io/include/pcl/io/impl/pcd_io.hpp b/io/include/pcl/io/impl/pcd_io.hpp index 0bafadd0aa8..c0630935408 100644 --- a/io/include/pcl/io/impl/pcd_io.hpp +++ b/io/include/pcl/io/impl/pcd_io.hpp @@ -351,11 +351,11 @@ pcl::PCDWriter::writeBinaryCompressed (const std::string &file_name, // pters[3] = &only_valid_data[offset_of_plane_RGB]; // std::vector pters (fields.size ()); - int toff = 0; + size_t toff = 0; for (size_t i = 0; i < pters.size (); ++i) { pters[i] = &only_valid_data[toff]; - toff += fields_sizes[i] * static_cast (cloud.points.size ()); + toff += static_cast(fields_sizes[i]) * cloud.points.size(); } // Go over all the points, and copy the data in the appropriate places