Repository navigation
Validate coding_params and unpacked bounds in Mesh::CreateFromQuantizedData. - #888
Merged
Merged
Conversation
copybara-service
Bot
force-pushed
the
test_1026456310
branch
3 times, most recently
from
November 20, 2026 21:03
ed0cfae to
732df5c
Compare
…edData. `Mesh::CreateFromQuantizedData` previously only checked `coding_params.size()`, without validating each attribute's `MeshAttributeCodingParams` or verifying that unpacked attribute bounds remain finite. On untrusted packed `CodedMesh` protos (via `DecodeMesh`), this allowed: - Wrong component counts in `coding_params` to trigger an out-of-bounds `SmallArray` read in `ComputeAttributeBounds`. - Non-finite `offset`/`scale` or `scale <= 0` to succeed in `DecodeMesh` and then trip `ABSL_DCHECK(IsValidCodingParams(...))` on the first `FloatVertexAttribute` / `VertexPosition` call. - Large finite `offset`/`scale` values whose unpacked bounds overflow `float` to produce non-finite vertex attributes. Expose `mesh_internal::IsValidCodingParams`, validate every attribute's `coding_params` and decoded min/max bounds in `Mesh::CreateFromQuantizedData`, and strengthen `DecodeMeshDoesNotCrashOnArbitraryInput` to read `Bounds()` and all unpacked vertex attributes. PiperOrigin-RevId: 1026710645
copybara-service
Bot
force-pushed
the
test_1026456310
branch
from
November 20, 2026 21:25
732df5c to
d07c80a
Compare
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.
Validate coding_params and unpacked bounds in Mesh::CreateFromQuantizedData.
Mesh::CreateFromQuantizedDatapreviously only checkedcoding_params.size(), without validating each attribute'sMeshAttributeCodingParamsor verifying that unpacked attribute bounds remain finite. On untrusted packedCodedMeshprotos (viaDecodeMesh), this allowed:coding_paramsto trigger an out-of-boundsSmallArrayread inComputeAttributeBounds.offset/scaleorscale <= 0to succeed inDecodeMeshand then tripABSL_DCHECK(IsValidCodingParams(...))on the firstFloatVertexAttribute/VertexPositioncall.offset/scalevalues whose unpacked bounds overflowfloatto produce non-finite vertex attributes.Expose
mesh_internal::IsValidCodingParams, validate every attribute'scoding_paramsand decoded min/max bounds inMesh::CreateFromQuantizedData, and strengthenDecodeMeshDoesNotCrashOnArbitraryInputto readBounds()and all unpacked vertex attributes.