mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-09 04:58:04 +02:00
mono-scan-convertor: Include space for the closing span
When estimating the maximum number of spans required for a particular width, we need to include a closing span. Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
2587b9dfd3
commit
300e32a4a9
1 changed files with 4 additions and 2 deletions
|
|
@ -390,13 +390,15 @@ _mono_scan_converter_init(struct mono_scan_converter *c,
|
|||
int xmax, int ymax)
|
||||
{
|
||||
cairo_status_t status;
|
||||
int max_num_spans;
|
||||
|
||||
status = polygon_init (c->polygon, ymin, ymax);
|
||||
if (unlikely (status))
|
||||
return status;
|
||||
|
||||
if (xmax - xmin > ARRAY_LENGTH(c->spans_embedded)) {
|
||||
c->spans = _cairo_malloc_ab (xmax - xmin,
|
||||
max_num_spans = xmax - xmin + 1;
|
||||
if (max_num_spans > ARRAY_LENGTH(c->spans_embedded)) {
|
||||
c->spans = _cairo_malloc_ab (max_num_spans,
|
||||
sizeof (cairo_half_open_span_t));
|
||||
if (unlikely (c->spans == NULL)) {
|
||||
polygon_fini (c->polygon);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue