Add initial partial UDF support#403
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughAdds new UDF descriptor structs, updates ChangesUDF Browser Module
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@filesystem/udf/udf_browser.ixx`:
- Around line 36-55: The findDescriptorOffset helper currently signals “not
found” with a uint32_t return value, which turns into UINT32_MAX and can be read
later in the descriptor parsing path. Change findDescriptorOffset to return
std::optional<uint32_t>, have callers like the logic around descriptor reads
check for the empty case before using the LBA, and add a guard for
main_vds.length == 0 so the loop bound in findDescriptorOffset cannot underflow.
Update the related read flow in udf_browser.ixx (including the code that uses
the returned offset) to skip reads when no descriptor is found.
- Around line 90-94: The root entry creation in the UDF browser currently
returns a copied udf::FileEntry from root_directory_data, but that object does
not retain the backing payload needed for extended attributes and allocation
descriptors. Update the root_directory_data / root_directory_file_entry flow so
the returned object owns or references the full buffer, and ensure the logic in
the root-directory reader and udf::FileEntry construction/usage in udf_defs.ixx
preserves the trailing payload instead of exposing only the fixed header.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: c953c3c2-003f-421e-8a5a-53bea78e1ddd
📒 Files selected for processing (4)
CMakeLists.txtfilesystem/udf/udf.ixxfilesystem/udf/udf_browser.ixxfilesystem/udf/udf_defs.ixx
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@filesystem/udf/udf_browser.ixx`:
- Line 24: The descriptor parsing in udf_browser.ixx is reading fields by
casting raw std::vector<uint8_t> storage directly to udf::* references, which is
undefined behavior. Update the descriptor access in the relevant parsing code
around AnchorVolumeDescriptorPointer and similar reads to first copy the bytes
into a properly created object, using a small std::memcpy or std::bit_cast
helper for fixed-size descriptors. Keep the existing flow, but ensure all udf::
descriptor reads go through real objects whose lifetime has started before
accessing their fields.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 7a226576-bd5f-4799-8f17-0ca5982f2c6e
📒 Files selected for processing (4)
CMakeLists.txtfilesystem/udf/udf.ixxfilesystem/udf/udf_browser.ixxfilesystem/udf/udf_defs.ixx
✅ Files skipped from review due to trivial changes (2)
- filesystem/udf/udf.ixx
- CMakeLists.txt
🚧 Files skipped from review as they are similar to previous changes (1)
- filesystem/udf/udf_defs.ixx
This PR only supports up to UDF 1.02 (maybe 1.50, haven't found any discs to test it with), and also doesn't fully support parsing the filesystem beyond the initial directory yet. Those will be in later PRs once I. figure out how to implement them.
In the meantime, the added functionality is tested and working, but as it isn't ready to be directly used by anything yet I haven't committed the temporary command I used to test it.
Summary by CodeRabbit