pixman_composite_trapezoids: Return early if mask_format is not of TYPE_ALPHA
authorSøren Sandmann Pedersen <ssp@redhat.com>
Thu, 13 Dec 2012 20:26:17 +0000 (15:26 -0500)
committerSøren Sandmann Pedersen <ssp@redhat.com>
Thu, 13 Dec 2012 21:10:41 +0000 (16:10 -0500)
commitc2cb303d33ec11390b93cabd90f0f95bc9264113
treeac090e79834fcbcb265607cedadeedbe3d5acf6e
parent1f0c02811ea71b36380b9d4029a248659bd9af50
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.
pixman/pixman-edge.c
pixman/pixman-trap.c