mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-03-17 19:30:39 +01:00
surface-fallback: Handle memfaults during clipping.
Don't be lazy, propagate the error rather than asserting.
This commit is contained in:
parent
2e3acee410
commit
a2a2bd62ff
1 changed files with 15 additions and 11 deletions
|
|
@ -133,10 +133,11 @@ _create_composite_mask_pattern (cairo_surface_pattern_t *mask_pattern,
|
|||
|
||||
if (clip != NULL) {
|
||||
status = _cairo_clip_get_region (clip, &clip_region);
|
||||
assert (! _cairo_status_is_error (status));
|
||||
|
||||
/* The all-clipped state should never propagate this far. */
|
||||
assert (status != CAIRO_INT_STATUS_NOTHING_TO_DO);
|
||||
if (unlikely (_cairo_status_is_error (status) ||
|
||||
status == CAIRO_INT_STATUS_NOTHING_TO_DO))
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
clip_surface = status == CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
}
|
||||
|
|
@ -346,12 +347,13 @@ _clip_and_composite_source (cairo_clip_t *clip,
|
|||
|
||||
if (clip != NULL) {
|
||||
status = _cairo_clip_get_region (clip, &clip_region);
|
||||
assert (! _cairo_status_is_error (status));
|
||||
if (unlikely (status == CAIRO_INT_STATUS_NOTHING_TO_DO))
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
if (unlikely (_cairo_status_is_error (status) ||
|
||||
status == CAIRO_INT_STATUS_NOTHING_TO_DO))
|
||||
{
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Create a surface that is mask IN clip */
|
||||
status = _create_composite_mask_pattern (&mask_pattern,
|
||||
clip,
|
||||
|
|
@ -444,9 +446,11 @@ _clip_and_composite (cairo_clip_t *clip,
|
|||
|
||||
if (clip != NULL) {
|
||||
status = _cairo_clip_get_region (clip, &clip_region);
|
||||
assert (! _cairo_status_is_error (status));
|
||||
if (unlikely (status == CAIRO_INT_STATUS_NOTHING_TO_DO))
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
if (unlikely (_cairo_status_is_error (status) ||
|
||||
status == CAIRO_INT_STATUS_NOTHING_TO_DO))
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
clip_surface = status == CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue