blob: 6a34c28a6250d4228641c644a54f3b07381249ff (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
https://bugs.gentoo.org/939607
https://gitlab.freedesktop.org/cairo/cairo/-/issues/870
https://gitlab.freedesktop.org/cairo/cairo/-/merge_requests/595
https://gitlab.freedesktop.org/cairo/cairo/-/commit/f19e2fe080ddcfce93c8234a919fd882f3d63362
From f19e2fe080ddcfce93c8234a919fd882f3d63362 Mon Sep 17 00:00:00 2001
From: Adrian Johnson <ajohnson@redneon.com>
Date: Fri, 13 Sep 2024 06:28:39 +0930
Subject: [PATCH] cff: Don't fail if no local subs
Fixes: #870
--- 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;
--
GitLab
|