Skip to content

Fix numeric overflow when accessing pixel data of very large images#3091

Merged
davisking merged 1 commit intodavisking:masterfrom
reunanen:fix-numeric-overflow-when-accessing-pixel-data-of-very-large-images
Jun 21, 2025
Merged

Fix numeric overflow when accessing pixel data of very large images#3091
davisking merged 1 commit intodavisking:masterfrom
reunanen:fix-numeric-overflow-when-accessing-pixel-data-of-very-large-images

Conversation

@reunanen
Copy link
Copy Markdown
Contributor

Problem: reading large images (in my case, it was a 40792x20480 RGBA PNG one) causes a crash, when the product row number * width step overflows a 32-bit integer

Solution: change the type of the width step to be size_t (and not long)

…PNG one) causes a crash, when the product row-number * width-step overflows a 32-bit integer

Solution: change the type of the width step to be `size_t` (and not `long`)
@davisking
Copy link
Copy Markdown
Owner

Yep, agreed. Should just be size_t. Thanks for the PR :)

@davisking davisking merged commit 3cb1f35 into davisking:master Jun 21, 2025
9 checks passed
@reunanen reunanen deleted the fix-numeric-overflow-when-accessing-pixel-data-of-very-large-images branch June 21, 2025 06:19
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.

2 participants