Conversation
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.
Contributor
|
The panic this fixes no longer exists in #989 got there first, by replacing the panicking But we shouldn't close this PR because the two fixes are not equivalent:
Want to rewrite the PR? |
Contributor
|
linebender/tiny-skia#182 is another fix (which fix the underlying crate) |
Contributor
|
The issue this PR tries to fix was resolved by #989 . I checked by applying this PR's regression test alone to current main, with none of its source changes and it passes. The We should close this PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
resvgis a source of panics. This PR fixes one such panic. There are a couple more crashes pending.