Skip to content

LZ4 block header parsing cleanup and additional regression tests - #291

Merged
embray merged 4 commits into
asdf-format:mainfrom
embray:issue-194
Oct 23, 2026
Merged

embray merged 4 commits into
asdf-format:mainfrom
embray:issue-194

Conversation

@embray

@embray embray commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator

Description

Resolves #194, adding several new tests that bring coverage for lz4.c > 90%. In the process caught a small bug (corner case) of a crash when encountering invalid LZ4 block data.

AI Disclosure

No AI used.

Those tests otherwise failed on a coverage build.
For almost any reason, but particularly if the userdata initialization
failed.  Such a failure is pretty catastrophic anyways, but better to
handle it cleanly than just crash.

This was caught while adding tests of all the LZ4 header read failure
modes in order to improve coverage, though almost any one of those tests
catches this bug.
@embray embray added this to the v0.3 milestone Oct 23, 2026
@embray embray added bug Something isn't working refactoring Changes to code structure or APIs labels Oct 23, 2026
This simplifies matters a lot by not maintaining some state for the header
parsing directly on the lz4 userdata.  Instead just a simple function
that parses an asdf_lz4_block_header_t in-place at the current position
(0, or after advancing the position after reading one block).
@embray
embray merged commit 44df073 into asdf-format:main Oct 23, 2026
12 checks passed
@embray
embray deleted the issue-194 branch October 23, 2026 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working refactoring Changes to code structure or APIs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Follow-ups to lz4 decompression bug

1 participant