Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(models): adapt chunk's contains() definition. #755

Merged
merged 1 commit into from
Feb 13, 2024
Merged

Conversation

qkaiser
Copy link
Contributor

@qkaiser qkaiser commented Feb 11, 2024

We were considering that a chunk A contains a chunk B if chunk B start after chunk A and ends before or on the same offset than chunk A.

This caused issues with compressed DMG images where two handlers would rightfully identify two chunks:

  • a bzip chunk starting at offset 0 and ending before the DMG plist
  • a DMG chunk starting at offset 0 and ending after the DMG footer

We therefore adapted our definition of contains() where a contained chunk can start at the same offset but ends before, or start after the containing chunk but can end on the same offset.

Resolve #753

Copy link
Contributor

@e3krisztian e3krisztian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

We were considering that a chunk A contains a chunk B if chunk B start
after chunk A and ends before or on the same offset than chunk A.

This caused issues with compressed DMG images where two handlers would
rightfully identify two chunks:
- a bzip chunk starting at offset 0 and ending before the DMG plist
- a DMG chunk starting at offset 0 and ending after the DMG footer

We therefore adapted our definition of contains() where a contained
chunk can start at the same offset but ends before, or start after the
containing chunk but can end on the same offset.
@qkaiser qkaiser merged commit 2e6a7ae into main Feb 13, 2024
14 checks passed
@qkaiser qkaiser deleted the 753-overlap-fix branch February 13, 2024 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error chunk has higher start_offset than end_offset with end_offset=0
2 participants