mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-01-09 15:50:30 +01:00
Fix off-by-one bug in tor22-scan-converter.
This makes the implementation in tor22-scan-converter match the one in tor-scan-converter.
This commit is contained in:
parent
82a2477a4a
commit
dfe3aa6d88
1 changed files with 5 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue