mirror of
https://salsa.debian.org/xorg-team/lib/pixman
synced 2025-08-30 17:04:35 +00:00
pixman_composite_trapezoids: Return early if mask_format is not of TYPE_ALPHA
stress-test -s 0x17ee crashes because pixman_composite_trapezoids() is given a mask_format of PIXMAN_c8, which causes it to create a temporary image with that format but without a palette. This causes crashes later. The only mask_format that we actually support are those of TYPE_ALPHA, so this patch add a return_if_fail() to ensure this. Similarly, although currently it won't crash if given an invalid format, alpha-only formats have always been the only thing that made sense for the pixman_rasterize_edges() functions, so add a return_if_fail() ensuring that the destination format is of type PIXMAN_TYPE_ALPHA.
This commit is contained in:
parent
1f0c02811e
commit
c2cb303d33
@ -374,6 +374,7 @@ pixman_rasterize_edges (pixman_image_t *image,
|
||||
pixman_fixed_t b)
|
||||
{
|
||||
return_if_fail (image->type == BITS);
|
||||
return_if_fail (PIXMAN_FORMAT_TYPE (image->bits.format) == PIXMAN_TYPE_A);
|
||||
|
||||
if (image->bits.read_func || image->bits.write_func)
|
||||
pixman_rasterize_edges_accessors (image, l, r, t, b);
|
||||
|
@ -491,6 +491,8 @@ pixman_composite_trapezoids (pixman_op_t op,
|
||||
{
|
||||
int i;
|
||||
|
||||
return_if_fail (PIXMAN_FORMAT_TYPE (mask_format) == PIXMAN_TYPE_A);
|
||||
|
||||
if (n_traps <= 0)
|
||||
return;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user