Skip to content

fix: combine alert fixes 3235–3249#140

Merged
bniladridas merged 29 commits into
mainfrom
combined-alert-fixes
May 4, 2026
Merged

fix: combine alert fixes 3235–3249#140
bniladridas merged 29 commits into
mainfrom
combined-alert-fixes

Conversation

@bniladridas

@bniladridas bniladridas commented May 4, 2026

Copy link
Copy Markdown
Member

Combines all 15 automated code scanning alert fixes for multiplication result converted to larger type. These changes span include/stb_image.h, include/stb_image_write.h, and src/preprocess.c with consistent application of size_t casts to prevent integer overflow before conversion to larger types. Overflow checks are added where allocation sizes are stored back into int variables such as out_size.

Note

Merging this pull request will automatically close #125, #126, #127, #128, #129, #130, #131, #132, #133, #134, #135, #136, #137, #138, #139

Close #125
Close #126
Close #127
Close #128
Close #129
Close #130
Close #131
Close #132
Close #133
Close #134
Close #135
Close #136
Close #137
Close #138
Close #139

Discussion

bniladridas and others added 29 commits May 4, 2026 19:48
… converted to larger type

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
… converted to larger type

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
… converted to larger type

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
… converted to larger type

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
… converted to larger type

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
… converted to larger type

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
… converted to larger type

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
… converted to larger type

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
… converted to larger type

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
… converted to larger type

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
… converted to larger type

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
… converted to larger type

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
… converted to larger type

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
… converted to larger type

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
… converted to larger type

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@changeset-bot

changeset-bot Bot commented May 4, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 31566db

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

github-actions Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

☑️ I checked the pre-commit hooks and there was nothing to fix at commit 31566db.

@github-actions github-actions Bot added the core label May 4, 2026
@bniladridas bniladridas changed the title fix: combine all multiplication overflow fixes from alerts 3235-3249 fix: combine alert fixes 3235–3249 May 4, 2026

@bniladridas bniladridas left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added inline comments for overflow fix explanations

Comment thread include/stb_image.h

@bniladridas bniladridas left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review

@bniladridas

Copy link
Copy Markdown
Member Author

Review notes:

  • include/stb_image.h (line ~7733): out_size is stored as int, so the allocation size is bounded by INT_MAX.
  • src/preprocess.c (line ~33): SIZE_MAX checks prevent integer overflow when calculating tile_w * tile_h * channels.
  • include/stb_image_write.h (line ~891): size_t casts prevent multiplication overflow in STBIW_REALLOC_SIZED.

Comment thread include/stb_image_write.h
Comment thread src/preprocess.c
@bniladridas

Copy link
Copy Markdown
Member Author

Merge was blocked because the inline review comments I added had unresolved threads. I resolved all three review threads in stb_image.h, stb_image_write.h and preprocess.c so the pull request is now ready to merge.

Note

All review threads must be resolved before a pull request can be merged on GitHub.

@bniladridas bniladridas merged commit 653a895 into main May 4, 2026
42 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators May 4, 2026
@github-actions github-actions Bot deleted the combined-alert-fixes branch May 4, 2026 16:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants