Commit dfe3aa6d authored by Antony Lee's avatar Antony Lee Committed by Uli Schlachter

Fix off-by-one bug in tor22-scan-converter.

This makes the implementation in tor22-scan-converter match the one in
tor-scan-converter.
parent 82a2477a
Pipeline #36203 failed with stage
in 5 minutes and 47 seconds
......@@ -1287,12 +1287,15 @@ glitter_scan_converter_reset(
int xmax, int ymax)
{
glitter_status_t status;
int max_num_spans;
converter->xmin = 0; converter->xmax = 0;
converter->ymin = 0; converter->ymax = 0;
if (xmax - xmin > ARRAY_LENGTH(converter->spans_embedded)) {
converter->spans = _cairo_malloc_ab (xmax - xmin,
max_num_spans = xmax - xmin + 1;
if (max_num_spans > ARRAY_LENGTH(converter->spans_embedded)) {
converter->spans = _cairo_malloc_ab (max_num_spans,
sizeof (cairo_half_open_span_t));
if (unlikely (converter->spans == NULL))
return _cairo_error (CAIRO_STATUS_NO_MEMORY);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment