Skip to content

Compression should ZI image_block to avoid UB - #676

Merged
solidpixel merged 1 commit into
mainfrom
issue_674
Oct 12, 2026
Merged

solidpixel merged 1 commit into
mainfrom
issue_674

Conversation

@solidpixel

@solidpixel solidpixel commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

The load_image_block functions only load the exact texel count in each block, but when used later the data arrays will over-fetch to the nearest SIMD multiple. This is benign, as the untouched values are zero weighted and never written, but enough to trigger an UB warning in some compilers.

This change ZI's the entire image_block structure once per compression thread, removing the UB. The decompression path was already doing this and is unaffected by this issue.

Fixes #674

@solidpixel solidpixel self-assigned this Oct 12, 2026
@solidpixel
solidpixel merged commit 25ad7b6 into main Oct 12, 2026
17 checks passed
@solidpixel
solidpixel deleted the issue_674 branch October 12, 2026 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Currently load_image_block only loads exact texel count, which can result in UB

1 participant