mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-03 04:17:59 +02:00
image: Don't rely on clip regions being clipped to surface extents.
Fixes a crash in test/clip-fill-unbounded [xlib-fallback].
This commit is contained in:
parent
15d9c5fcd8
commit
f979dd22d8
1 changed files with 20 additions and 12 deletions
|
|
@ -3918,13 +3918,17 @@ _cairo_image_surface_composite (cairo_operator_t op,
|
|||
extents.bounded.width = width;
|
||||
extents.bounded.height = height;
|
||||
|
||||
extents.unbounded.x = 0;
|
||||
extents.unbounded.y = 0;
|
||||
extents.unbounded.width = dst->width;
|
||||
extents.unbounded.height = dst->height;
|
||||
|
||||
if (clip_region != NULL) {
|
||||
cairo_region_get_extents (clip_region, &extents.unbounded);
|
||||
} else {
|
||||
extents.unbounded.x = 0;
|
||||
extents.unbounded.y = 0;
|
||||
extents.unbounded.width = dst->width;
|
||||
extents.unbounded.height = dst->height;
|
||||
cairo_rectangle_int_t rect;
|
||||
|
||||
cairo_region_get_extents (clip_region, &rect);
|
||||
if (! _cairo_rectangle_intersect (&extents.unbounded, &rect))
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
extents.is_bounded = _cairo_operator_bounded_by_either (op);
|
||||
|
|
@ -4066,13 +4070,17 @@ _cairo_image_surface_composite_trapezoids (cairo_operator_t op,
|
|||
extents.bounded.width = width;
|
||||
extents.bounded.height = height;
|
||||
|
||||
extents.unbounded.x = 0;
|
||||
extents.unbounded.y = 0;
|
||||
extents.unbounded.width = dst->width;
|
||||
extents.unbounded.height = dst->height;
|
||||
|
||||
if (clip_region != NULL) {
|
||||
cairo_region_get_extents (clip_region, &extents.unbounded);
|
||||
} else {
|
||||
extents.unbounded.x = 0;
|
||||
extents.unbounded.y = 0;
|
||||
extents.unbounded.width = dst->width;
|
||||
extents.unbounded.height = dst->height;
|
||||
cairo_rectangle_int_t rect;
|
||||
|
||||
cairo_region_get_extents (clip_region, &rect);
|
||||
if (! _cairo_rectangle_intersect (&extents.unbounded, &rect))
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
extents.is_bounded = _cairo_operator_bounded_by_either (op);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue