diff options
author | Adrian Johnson <ajohnson@redneon.com> | 2024-06-26 20:05:14 +0930 |
---|---|---|
committer | Adrian Johnson <ajohnson@redneon.com> | 2024-06-27 07:07:22 +0930 |
commit | 6967beb24ec605a4028ed4d0d065eefc5eb70ceb (patch) | |
tree | 7ac10d081ae5f7e3367e1073b841a36b3b2570b4 | |
parent | 16dd5cd4c2fb74ad6ef0d0a221b97d0c222d259f (diff) |
ps: fix max form size
Fixes: #845
-rw-r--r-- | src/cairo-ps-surface.c | 4 | ||||
-rw-r--r-- | test/mime-unique-id.c | 9 |
2 files changed, 8 insertions, 5 deletions
diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c index 1d2bba20e..5421c39c9 100644 --- a/src/cairo-ps-surface.c +++ b/src/cairo-ps-surface.c @@ -3507,13 +3507,13 @@ _cairo_ps_surface_use_form (cairo_ps_surface_t *surface, if (surface->ps_level == CAIRO_PS_LEVEL_3) max_size = MAX_L3_FORM_DATA; else - max_size = MAX_L3_FORM_DATA; + max_size = MAX_L2_FORM_DATA; /* Don't add any more Forms if we exceed the form memory limit */ if (surface->total_form_size + params->approx_size > max_size) return CAIRO_INT_STATUS_UNSUPPORTED; - surface->total_form_size += params->approx_size > max_size; + surface->total_form_size += params->approx_size; unique_id = _cairo_malloc (source_key.unique_id_length); if (unique_id == NULL) return _cairo_error (CAIRO_STATUS_NO_MEMORY); diff --git a/test/mime-unique-id.c b/test/mime-unique-id.c index aab93164d..8d4a16133 100644 --- a/test/mime-unique-id.c +++ b/test/mime-unique-id.c @@ -79,10 +79,13 @@ * * If the size check fails, manually check the output and if the * surfaces are still embedded only once, update the expected sizes. + * + * Note: The PS2 output will embed the image more than once due to the + * lower MAX_L2_FORM_DATA for PS2 in cairo-ps-surface.c. */ -#define PS2_EXPECTED_SIZE 417510 -#define PS3_EXPECTED_SIZE 381554 -#define PDF_EXPECTED_SIZE 162923 +#define PS2_EXPECTED_SIZE 626926 +#define PS3_EXPECTED_SIZE 381555 +#define PDF_EXPECTED_SIZE 162692 #define SIZE_TOLERANCE 5000 static const char *png_filename = "romedalen.png"; |