Skip to content

Fix panic on filter regions with coordinates outside the i32 range#1089

Open
jschwe wants to merge 1 commit into
linebender:mainfrom
jschwe:fix_panic_on_overflow
Open

Fix panic on filter regions with coordinates outside the i32 range#1089
jschwe wants to merge 1 commit into
linebender:mainfrom
jschwe:fix_panic_on_overflow

Conversation

@jschwe

@jschwe jschwe commented Jul 3, 2026

Copy link
Copy Markdown

NonZeroRect::to_int_rect panics when the rect has coordinates outside the i32 range.
Instead, add a clamped_int_rect helper, which performs the clamping without panicking.
Adds a test, which panics before this fix.

Background: We started fuzzing servo more intensively recently, and resvg is a source of panics. This PR fixes one such panic. There are a couple more crashes pending.

NonZeroRect::to_int_rect panics when the rect has coordinates outside
the i32 range.
Instead add a clamped_int_rect helper, which performs the clamping without panicking.
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