Repository navigation
iloc: preserve versioned fields on encode - #203
Conversation
bradh
left a comment
There was a problem hiding this comment.
Minor updates for valid construction method values. Otherwise LGTM.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. WalkthroughIloc encoding now selects the required version and field widths from item and extent data. It validates construction methods and field limits, and returns errors when values cannot fit the selected fields. Tests cover version 1 and version 2 round trips, 64-bit extent values, and rejected inputs. Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to Iloc encoding now preserves versioned fields and rejects values that cannot be represented, instead of silently truncating them. No merge-blocking risk was identified in the supplied context. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change improves metadata integrity by preserving versioned fields and avoiding silent numeric truncation. No concrete security bypass was identified. Remaining uncertainty concerns downstream reader compatibility, output limits, and handling of buffers after encoding errors. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
|
@coderabbitai: full review |
|
|
Summary
ilocversion 1 or 2 when construction methods, extent indexes, large item IDs, or large item counts require itu32Root cause
Iloc::encode_body_extalways emitted version 0 with fixed 32-bit extent fields and no extent index field. Re-encoding decoded HEIF/AVIF metadata could therefore change the meaning of item locations or silently truncate values.Impact
Versioned
ilocdata now round-trips without losingconstruction_methodoritem_reference_index, and values above the 32-bit and 16-bit boundaries are either encoded with the required representation or rejected explicitly.Validation
cargo test --all-targets(241 passed)cargo clippy --all-targets --all-features -- -D warningscargo fmt --all -- --checkgit diff --checkCloses #191