Repository navigation
fix: reject inconsistent point clouds; make ros_message_definitions.hpp includable twice - #141
Merged
Merged
Conversation
…pp includable twice - PointcloudEncoder refuses a field that does not fit in point_step: the field encoders read at field.offset inside every point, so such a field read past the end of the cloud. Covers every caller (ROS, PCL, Python, WASM). - convertPointCloud2ToCompressedCloud refuses a cloud whose width*height*point_step disagrees with its data size: the header repeats width/height, so the result could not be decoded. - ros_message_definitions.hpp defined non-inline globals: including it from two translation units failed to link (multiple definition). Now inline constexpr. Each was reproduced by a test (or a link failure) before the fix. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01711BZcEtp3KsoF9uZHNFME
facontidavide
added a commit
that referenced
this pull request
Sep 20, 2026
facontidavide
added a commit
to PlotJuggler/plotjuggler_bridge
that referenced
this pull request
Sep 20, 2026
…validation Cloudini 1.3.1 (facontidavide/cloudini#141, #142) can be embedded as-is and validates malformed clouds itself, so this removes what compensated for that: the scoped fetch function (hidden ament_cmake, disabled zstd/PCL lookups, undone CMAKE_BUILD_TYPE, FetchContent_Populate + EXCLUDE_FROM_ALL), the data_path.hpp relocation, and check_cloud() in the transform. The InconsistentCloudMetadataIsRejected test stays and now covers the upstream check. Clean rebuild against the released tarball: 303 tests, static link, no PCL, nothing of Cloudini installed. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01711BZcEtp3KsoF9uZHNFME
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three defects found while integrating Cloudini into pj_bridge, where point clouds arrive from arbitrary DDS peers. Each was reproduced by a test (or a link failure) before the fix.
SizeOf(type)bytes atfield.offsetinside every point, and nothing checked that the field fits inpoint_step.PointcloudEncodernow refuses such anEncodingInfoat construction, which covers every caller (ROS, PCL, Python, WASM).width*height*point_stepdisagreeing with the data → undecodable output.convertPointCloud2ToCompressedCloudencodesdata.size()/point_steppoints but the header repeats the message'swidth/height; decoders then fail with "ended before all declared points". It now throws instead.ros_message_definitions.hppcould only be included once per binary. It defined non-inlineconst char*globals, so a second translation unit including it failed to link (multiple definition of 'compressed_schema_data'). They are nowinline constexpr.Tests
InconsistentPointCloud2IsRejected,EncoderRejectsFieldOutsidePointStep, and the header is now included from bothtest_ros_msg.cppandtest_header.cpp(which is what reproduced the link error). 28/28 pass.Not changed
is_bigendianandPointField.countare still ignored by the deserializer — known limitations, left as they are.🤖 Generated with Claude Code
https://claude.ai/code/session_01711BZcEtp3KsoF9uZHNFME