Skip to content

reject list-typed vertex properties in PlyDecoder::DecodeVertexData - #1273

Open
naaz234 wants to merge 1 commit into
google:mainfrom
naaz234:ply-reject-list-vertex-props
Open

naaz234 wants to merge 1 commit into
google:mainfrom
naaz234:ply-reject-list-vertex-props

Conversation

@naaz234

@naaz234 naaz234 commented Nov 17, 2026

Copy link
Copy Markdown

PlyDecoder::DecodeVertexData reads x/y/z, nx/ny/nz and red/green/blue/alpha through PlyPropertyReader::ReadValue(i) for every vertex, assuming one scalar per vertex, but the header may declare any of them as a list (property list uchar float x). PlyReader then stores only the list elements, so the property's data can hold fewer than num_entries values and ReadValue reads past the end of the heap buffer. an ascii file with element vertex 4, a list-typed x and four 0 1 2 rows crashes ReadPointCloudFromFile/draco_encoder (access violation before the patch, empty data vector). the check lives in DecodeVertexData because that is where the one-value-per-vertex assumption is made; positions and colors now fail like the existing wrong-type cases, list normals are skipped like non-float normals. PlyDecoderTest.TestListVertexPropertyRejected covers it and draco_tests passes (205 tests).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant