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.
| 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. |
| 111 | uint32_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 |
no outgoing calls
no test coverage detected