We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 09fad21 commit dee87f1Copy full SHA for dee87f1
rviz_default_plugins/src/rviz_default_plugins/displays/pointcloud/point_cloud2_display.cpp
@@ -104,7 +104,11 @@ sensor_msgs::msg::PointCloud2::ConstSharedPtr PointCloud2Display::filterOutInval
104
filtered->header = cloud->header;
105
filtered->fields = cloud->fields;
106
filtered->height = 1;
107
- filtered->width = static_cast<uint32_t>(filtered->data.size() / cloud->point_step);
+ if (cloud->point_step > 0) {
108
+ filtered->width = static_cast<uint32_t>(filtered->data.size() / cloud->point_step);
109
+ } else {
110
+ filtered->width = 0;
111
+ }
112
filtered->is_bigendian = cloud->is_bigendian;
113
filtered->point_step = cloud->point_step;
114
filtered->row_step = filtered->width;
0 commit comments