Skip to content

Fix B5 (is_file_type bounds check) and B6 (PLY vmap validation)#32

Merged
csparker247 merged 2 commits intodevelopfrom
worktree-agent-a40c64cf
Mar 15, 2026
Merged

Fix B5 (is_file_type bounds check) and B6 (PLY vmap validation)#32
csparker247 merged 2 commits intodevelopfrom
worktree-agent-a40c64cf

Conversation

@csparker247
Copy link
Copy Markdown
Member

Summary

  • B5: is_file_type in MeshIOFormats.hpp called ext[0] on path.extension().string() without checking if the string was empty, causing undefined behavior for paths with no extension (e.g. "mesh"). Added an ext.empty() guard that returns false early.

  • B6: The PLY reader initialized vmap{} to {0,0,0}. If the PLY header was missing any of the x, y, or z vertex properties, the missing indices silently stayed at 0, causing reads from the wrong data column. Added a vmapFound tracking array and validation that throws std::runtime_error if any of x/y/z are absent.

Adds two new tests:

  • MeshIO.IsFileTypeNoExtension — asserts no-extension path returns false without UB
  • MeshIO.PLY_MissingVertexProperty — asserts std::runtime_error for a PLY with missing z

Test plan

  • All 6 test suites pass (ctest 100%)
  • Both new tests pass
  • All existing IO tests pass

Closes #10
Closes #11

csparker247 and others added 2 commits March 15, 2026 12:30
B5: Guard against empty extension string in is_file_type to avoid
undefined behavior when a path has no extension.

B6: Track which of x/y/z vertex properties are found during PLY header
parsing and throw std::runtime_error if any are missing, preventing
silent reads from the wrong column.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@csparker247 csparker247 merged commit b02af06 into develop Mar 15, 2026
7 checks passed
@csparker247 csparker247 deleted the worktree-agent-a40c64cf branch March 15, 2026 19:17
csparker247 added a commit that referenced this pull request Mar 15, 2026
All five bug tracks resolved via PRs #30, #31, #32 (merged to develop).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

[B6] PLY reader vmap silently reads wrong column if x/y/z properties absent [B5] is_file_type accesses ext[0] without bounds check

1 participant