2 commits - src/cairo-cff-subset.c

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Sep 12 23:36:38 UTC 2024


 src/cairo-cff-subset.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

New commits:
commit b9eed915f9a67380e7ef9d8746656455c43f67e2
Merge: 62d99c8a6 f19e2fe08
Author: Emmanuele Bassi <ebassi at gmail.com>
Date:   Thu Sep 12 23:36:36 2024 +0000

    Merge branch 'issue-870' into 'master'
    
    cff: Don't fail if no local subs
    
    Closes #870
    
    See merge request cairo/cairo!595

commit f19e2fe080ddcfce93c8234a919fd882f3d63362
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Fri Sep 13 06:28:39 2024 +0930

    cff: Don't fail if no local subs
    
    Fixes: #870

diff --git a/src/cairo-cff-subset.c b/src/cairo-cff-subset.c
index 076cb2b0a..8a7de0065 100644
--- a/src/cairo-cff-subset.c
+++ b/src/cairo-cff-subset.c
@@ -952,9 +952,13 @@ cairo_cff_font_read_private_dict (cairo_cff_font_t   *font,
 	 decode_number (operand, nominal_width);
 
     num_subs = _cairo_array_num_elements (local_sub_index);
-    *local_subs_used = _cairo_calloc_ab (num_subs, sizeof (cairo_bool_t));
-    if (unlikely (*local_subs_used == NULL))
-	return _cairo_error (CAIRO_STATUS_NO_MEMORY);
+    if (num_subs > 0) {
+	*local_subs_used = _cairo_calloc_ab (num_subs, sizeof (cairo_bool_t));
+	if (unlikely (*local_subs_used == NULL))
+	    return _cairo_error (CAIRO_STATUS_NO_MEMORY);
+    } else {
+	*local_subs_used = NULL;
+    }
 
     if (num_subs < 1240)
 	*local_sub_bias = 107;


More information about the cairo-commit mailing list