Skip to content

Zero-init partition candidate stack arrays#619

Merged
solidpixel merged 1 commit into
mainfrom
issue_618
May 26, 2026
Merged

Zero-init partition candidate stack arrays#619
solidpixel merged 1 commit into
mainfrom
issue_618

Conversation

@solidpixel
Copy link
Copy Markdown
Contributor

@solidpixel solidpixel commented May 26, 2026

The find_best_partition_candidates() function can use uninitialized data in the uncor_best_partitions and samec_best_partitions arrays as an index if most partition candidates fail to give a good result. Specifically, if fewer than requested_candidates result in an error that is lower than ERROR_CALC_DEFAULT, the tail of the array will not be initialized.

This is expected to be very unlikely in real use, where the data is a real texture and a large number of possible partition candidates are used, but it's possible if using a very restricted partition set with random texture data.

Fixes #618.

@solidpixel solidpixel merged commit 2b86c03 into main May 26, 2026
9 of 27 checks passed
@solidpixel solidpixel deleted the issue_618 branch May 26, 2026 14:23
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.

find_best_partition_candidates can read uninitialized data if most candidates fail partition selection

1 participant