Skip to content

Simplify RankFilter.c check#9662

Merged
radarhere merged 1 commit into
python-pillow:mainfrom
radarhere:rank_size
Jun 6, 2026
Merged

Simplify RankFilter.c check#9662
radarhere merged 1 commit into
python-pillow:mainfrom
radarhere:rank_size

Conversation

@radarhere

Copy link
Copy Markdown
Member

if (size > INT_MAX / size || size > INT_MAX / (size * (int)sizeof(FLOAT32))) {

The first condition here is made redundant by the second - if size * size > INT_MAX, then size * size * sizeof(FLOAT32) > INT_MAX will be true as well.

This code was added in 52d60cd

@hugovk hugovk changed the title Simplified check Simplify RankFilter.c check Jun 6, 2026
@hugovk hugovk added the automerge Automatically merge PRs that are ready label Jun 6, 2026
@radarhere radarhere merged commit e55c000 into python-pillow:main Jun 6, 2026
60 of 63 checks passed
@radarhere radarhere deleted the rank_size branch June 6, 2026 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge Automatically merge PRs that are ready Cleanup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants