Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions common/include/pcl/point_cloud.h
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,12 @@ namespace pcl
inline void
assign(InputIterator first, InputIterator last, index_t new_width)
{
if (new_width == 0) {
PCL_WARN("Assignment with new_width equal to 0,"
"setting width to size of the cloud and height to 1\n");
return assign(std::move(first), std::move(last));
}

points.assign(std::move(first), std::move(last));
width = new_width;
height = size() / width;
Expand Down Expand Up @@ -631,6 +637,11 @@ namespace pcl
void
inline assign(std::initializer_list<PointT> ilist, index_t new_width)
{
if (new_width == 0) {
PCL_WARN("Assignment with new_width equal to 0,"
"setting width to size of the cloud and height to 1\n");
return assign(std::move(ilist));
}
points.assign(std::move(ilist));
width = new_width;
height = size() / width;
Expand Down