mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 19:18:12 +02:00
ps: Check earlier for a supported mask
Fixes crash in fill-and-stroke-alpha. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
13bd9592d8
commit
088d483043
1 changed files with 4 additions and 6 deletions
|
|
@ -1812,13 +1812,15 @@ _cairo_ps_surface_analyze_operation (cairo_ps_surface_t *surface,
|
|||
}
|
||||
|
||||
if (! pattern_supported (surface, pattern))
|
||||
{
|
||||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
}
|
||||
|
||||
if (! (op == CAIRO_OPERATOR_SOURCE || op == CAIRO_OPERATOR_OVER))
|
||||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
|
||||
/* Mask is only supported when the mask is an image with opaque or bilevel alpha. */
|
||||
if (mask && !mask_supported (surface, mask))
|
||||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
|
||||
if (pattern->type == CAIRO_PATTERN_TYPE_SURFACE) {
|
||||
cairo_surface_pattern_t *surface_pattern = (cairo_surface_pattern_t *) pattern;
|
||||
|
||||
|
|
@ -1837,10 +1839,6 @@ _cairo_ps_surface_analyze_operation (cairo_ps_surface_t *surface,
|
|||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/* Mask is only supported when the mask is an image with opaque or bilevel alpha. */
|
||||
if (mask && !mask_supported (surface, mask))
|
||||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
|
||||
/* CAIRO_OPERATOR_OVER is only supported for opaque patterns. If
|
||||
* the pattern contains transparency, we return
|
||||
* CAIRO_INT_STATUS_FLATTEN_TRANSPARENCY to the analysis
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue