Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guard against overflow in blur code #4968

Open
wants to merge 2 commits into
base: 25.lts.1+
Choose a base branch
from

Conversation

dahlstrom-g
Copy link
Contributor

Fixed: 398591179

herbderby and others added 2 commits January 25, 2025 15:00
This fuzz creates a blur that has w = 1 and h = 2^31 - epsilon.
And a filter sigma of 360. This causes the intermediate
buffer size > 2^31. This causes the multiply in the following
code SkMaskBlurFilter.cpp:1023:

  tmpStart + tmpW * tmpH

to overflow. Because tmpW = source height, which is near 2^31,
and tmpH is about 3*360.

Cause the blur to fail if the intermediate buffer is > INT_MAX.

(cherry picked from commit b70a030066b554b0fc7ba4c061449ac486a62283)

Reviewed-on: https://skia-review.googlesource.com/c/skia/+/558305
Fixed: 398591179
Reviewed-on: youtube#4968
@youtube youtube deleted a comment from google-cla bot Feb 25, 2025
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