MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / rowStepFor

Function rowStepFor

pj_scene3D/core/src/pointcloud_codecs.cpp:111–115  ·  view source on GitHub ↗

row_step = point_step * width, computed in uint64 and clamped to UINT32_MAX so an adversarial width/point_step product cannot silently wrap the uint32 field (L.10). Real clouds never approach this; the clamp keeps the published canonical object's row_step honest for any out-of-module consumer that addresses rows by it.

Source from the content-addressed store, hash-verified

109// Real clouds never approach this; the clamp keeps the published canonical object's
110// row_step honest for any out-of-module consumer that addresses rows by it.
111uint32_t rowStepFor(uint32_t point_step, uint32_t width) {
112 const uint64_t row_step = static_cast<uint64_t>(point_step) * static_cast<uint64_t>(width);
113 return row_step > std::numeric_limits<uint32_t>::max() ? std::numeric_limits<uint32_t>::max()
114 : static_cast<uint32_t>(row_step);
115}
116
117} // namespace
118

Callers 2

decodeCloudiniFunction · 0.85
decodeDracoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected