Skip to content

Fix integer overflow in image decoders#26682

Open
nidu-ninja wants to merge 2 commits intoSerenityOS:masterfrom
nidu-ninja:image-decoder-integer-overflow
Open

Fix integer overflow in image decoders#26682
nidu-ninja wants to merge 2 commits intoSerenityOS:masterfrom
nidu-ninja:image-decoder-integer-overflow

Conversation

@nidu-ninja
Copy link
Copy Markdown

Fix multiple integer overflow/underflow issues in image decoders (TIFF, CCITT, BMP)

Replaced unchecked arithmetic with Checked in several parsing paths to prevent wraparound in size and row calculations. Malformed inputs could previously trigger large allocations or out-of-bounds behavior.

Adds regression tests covering malformed TIFF (strip count mismatch, CCITT dimensions) and BMP RLE buffer size overflow cases.

@github-actions github-actions bot added the 👀 pr-needs-review PR needs review from a maintainer or community member label Mar 23, 2026
@BuggieBot
Copy link
Copy Markdown
Member

Hello!

One or more of the commit messages in this PR do not match the SerenityOS code submission policy, please check the lint_commits CI job for more details on which commits were flagged and why.
Please do not close this PR and open another, instead modify your commit message(s) with git commit --amend and force push those changes to update this PR.

@nidu-ninja nidu-ninja force-pushed the image-decoder-integer-overflow branch from 7c392b5 to cdc3642 Compare March 23, 2026 15:17
@LucasChollet
Copy link
Copy Markdown
Member

Thanks for fixing these. The test cases are missing though.

@nidu-ninja
Copy link
Copy Markdown
Author

Thanks for fixing these. The test cases are missing though.

i have added the flies

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

👀 pr-needs-review PR needs review from a maintainer or community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants