mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 18:08:03 +02:00
[cairo-image-surface] Avoid malloc(0)
Special case width==0, height==0 to avoid allocating a 0 byte image.
This commit is contained in:
parent
7332a5e994
commit
85d911d86c
1 changed files with 3 additions and 0 deletions
|
|
@ -921,6 +921,9 @@ _cairo_image_surface_composite_trapezoids (cairo_operator_t op,
|
|||
pixman_traps[i].right.p2.y = _cairo_fixed_to_16_16 (traps[i].right.p2.y);
|
||||
}
|
||||
|
||||
if (height == 0 || width == 0)
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
|
||||
/* Special case adding trapezoids onto a mask surface; we want to avoid
|
||||
* creating an intermediate temporary mask unnecessarily.
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue