mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-08 13:48:02 +02:00
[pattern] Beware unsigned wrap-around with pathological surface patterns.
A surface pattern under an extreme transformation could lie entirely in the negative quadrant. This would trigger the fixup such that it's lower left corner was clamped to the origin, but the upper right corner was left unchecked. This could result in the width,height being negative and wrapping around to large values instead of being clamped to 0.
This commit is contained in:
parent
3c6d3684e9
commit
8f51ea4657
1 changed files with 2 additions and 2 deletions
|
|
@ -1821,8 +1821,8 @@ _cairo_pattern_acquire_surface_for_surface (cairo_surface_pattern_t *pattern,
|
|||
*/
|
||||
x = MAX (0, floor (x1) - 1);
|
||||
y = MAX (0, floor (y1) - 1);
|
||||
width = MIN (extents.width, ceil (x2) + 1) - x;
|
||||
height = MIN (extents.height, ceil (y2) + 1) - y;
|
||||
width = MAX (MIN (extents.width, ceil (x2) + 1) - x, 0);
|
||||
height = MAX (MIN (extents.height, ceil (y2) + 1) - y, 0);
|
||||
}
|
||||
x += tx;
|
||||
y += ty;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue