Repository navigation
Conversation
Files written in the legacy lz4 frame format (`lz4 -l`, used for Linux kernel images) start with the magic number 0x184C2102. lz4_flex already decodes them, but the signature check only knew the current frame magic, so these files were not recognized without an `.lz4` extension. Fixes ouch-org#1104 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1104
Files made with
lz4 -l(the legacy frame format, used for Linux kernel images) start with the magic number0x184C2102.lz4_flexalready decodes them, buttry_infer_formatonly checked for the current frame magic0x184D2204. So without an.lz4extension ouch refused the file, and with one it printed "Failed to confirm the format ... file might be misnamed".This adds the legacy magic to
is_lz4(lz4 frame format spec, "Legacy frame"). I didn't add0x184C2103from the issue: it isn't in the spec andlz4_flexcan't decode it.Tests: a unit test for the signature, and an integration test that decompresses a legacy frame with no extension.
I used Claude Code to write this change.