gazebosim / gz-gui

Builds on top of Qt to provide widgets which are useful when developing robotics applications, such as a 3D view, plots, dashboard, etc, and can be used together in a convenient unified interface.
https://gazebosim.org
Apache License 2.0
67 stars 39 forks source link

Tries to fix a scenario when a user sends a malformed point cloud #494

Closed arjo129 closed 1 year ago

arjo129 commented 1 year ago

🦟 Bug fix

Fixes #

Summary

This PR fixes a rather odd bug. Essentially if a user were to malform a pointcloud by claiming the point cloud to contain only "x,y,z" fields but has a datasize larger than that, the condition iterX == iterX.End() && iterY == iterY.End() && iterZ == iterZ.End(); does not get met. Thus the system will keep iterating till a segfault comes along. This PR enforces better check to make sure we do not segfault.

Checklist

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

codecov[bot] commented 1 year ago

Codecov Report

Merging #494 (e610455) into gz-gui7 (0d754ab) will decrease coverage by 0.04%. The diff coverage is 0.00%.

@@             Coverage Diff             @@
##           gz-gui7     #494      +/-   ##
===========================================
- Coverage    67.82%   67.77%   -0.05%     
===========================================
  Files           44       44              
  Lines         4826     4829       +3     
===========================================
  Hits          3273     3273              
- Misses        1553     1556       +3     
Impacted Files Coverage Δ
src/plugins/point_cloud/PointCloud.cc 16.58% <0.00%> (-0.24%) :arrow_down:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.