Skip to content

guard against size_t overflow in output pixel allocation#206

Open
uwezkhan wants to merge 1 commit intogoogle:mainfrom
uwezkhan:32bit-overflow-guard
Open

guard against size_t overflow in output pixel allocation#206
uwezkhan wants to merge 1 commit intogoogle:mainfrom
uwezkhan:32bit-overflow-guard

Conversation

@uwezkhan
Copy link
Copy Markdown

Prevent potential integer overflow in buffer size calculation during
output pixel allocation. The previous logic performed unchecked
arithmetic (e.g., width * height * channels), which could wrap on large
inputs and lead to insufficient allocation.

This change adds safe overflow checks and ensures allocation sizes are
properly bounded.

Related: libjxl/libjxl#4644

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.

1 participant