diff options
-rw-r--r-- | main/cairo/APKBUILD | 20 | ||||
-rw-r--r-- | main/cairo/CVE-2018-19876.patch | 30 | ||||
-rw-r--r-- | main/cairo/cff-allow-empty-array-of-operands-for-certain-operat.patch | 119 | ||||
-rw-r--r-- | main/cairo/composite_color_glyphs.patch | 58 | ||||
-rw-r--r-- | main/cairo/pdf-flush.patch | 33 | ||||
-rw-r--r-- | main/cairo/pdf-font-subset-Generate-valid-font-names.patch | 58 |
6 files changed, 66 insertions, 252 deletions
diff --git a/main/cairo/APKBUILD b/main/cairo/APKBUILD index e4b684c330..bbaf81bef1 100644 --- a/main/cairo/APKBUILD +++ b/main/cairo/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=cairo -pkgver=1.16.0 -pkgrel=3 +pkgver=1.17.4 +pkgrel=0 pkgdesc="A vector graphics library" url="https://cairographics.org/" arch="all" @@ -33,13 +33,10 @@ subpackages=" $pkgname-tools $pkgname-dbg " -source="https://cairographics.org/releases/cairo-$pkgver.tar.xz +source="https://cairographics.org/snapshots/cairo-$pkgver.tar.xz musl-stacksize.patch - CVE-2018-19876.patch - pdf-flush.patch fix-mask-usage-in-image-compositor.patch - composite_color_glyphs.patch - cff-allow-empty-array-of-operands-for-certain-operat.patch + pdf-font-subset-Generate-valid-font-names.patch " builddir="$srcdir/$pkgname-$pkgver" @@ -89,10 +86,9 @@ tools() { amove usr/lib/cairo/libcairo-trace.* } -sha512sums="9eb27c4cf01c0b8b56f2e15e651f6d4e52c99d0005875546405b64f1132aed12fbf84727273f493d84056a13105e065009d89e94a8bfaf2be2649e232b82377f cairo-1.16.0.tar.xz +sha512sums=" +843dce4f1cb5d9fb0c33240dff658ba2723bf04697045d16669e4b7674a5287ef0eb3d960a688a129902fb714230263e35d085186dc220b65307b5ad7fa09d23 cairo-1.17.4.tar.xz 86f26fe41deb5e14f553c999090d1ec1d92a534fa7984112c9a7f1d6c6a8f1b7bb735947e8ec3f26e817f56410efe8cc46c5e682f6a278d49b40a683513740e0 musl-stacksize.patch -8f13cdcae0f134e04778cf5915f858fb8d5357a7e0a454791c93d1566935b985ec66dfe1683cd0b74a1cb44a130923d7a27cf006f3fc70b9bee93abd58a55aa3 CVE-2018-19876.patch -533ea878dc7f917af92e2694bd3f535a09cde77f0ecd0cc00881fbc9ec1ea86f60026eacc76129705f525f6672929ad8d15d8cfe1bfa61e9962e805a7fbded81 pdf-flush.patch 20699d2dd10531f99587cdcd187a23e23bca5a9f031255c95aade4dadb79bbb62118c7ddff677c2fd20e4ba7694eee4debcd79a4d0736d62951a4fcee56ccae0 fix-mask-usage-in-image-compositor.patch -a056e85549e8410782674cb4ce7b38b035cdde8f4319c18dd942a18b33d35c5be4d0c0c34081ee556473df4f2725cdba508a387ee6222214484b10a5d9eaad90 composite_color_glyphs.patch -ae079840a842ec645ab3c9a2d5db8d3f8bb4e25ce4090afc3d226ba292f15b85bdaaed0967bb12bfa429d7f6376a28c87518df194ab6b1d2a2e7c96ab6df8ba2 cff-allow-empty-array-of-operands-for-certain-operat.patch" +9c12c0d4d0e379130432b723d3b4e79c7c66a3b3beecef7b117b3e2e078ee97b3b6c720dc0cb866cb754340ac50c0b2f29b99f1a5524bb702c975062702ee81d pdf-font-subset-Generate-valid-font-names.patch +" diff --git a/main/cairo/CVE-2018-19876.patch b/main/cairo/CVE-2018-19876.patch deleted file mode 100644 index c9cd71f4ae..0000000000 --- a/main/cairo/CVE-2018-19876.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 90e85c2493fdfa3551f202ff10282463f1e36645 Mon Sep 17 00:00:00 2001 -From: Carlos Garcia Campos <cgarcia@igalia.com> -Date: Mon, 19 Nov 2018 12:33:07 +0100 -Subject: [PATCH] ft: Use FT_Done_MM_Var instead of free when available in - cairo_ft_apply_variations - -Fixes a crash when using freetype >= 2.9 ---- - src/cairo-ft-font.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c -index 325dd61b4..981973f78 100644 ---- a/src/cairo-ft-font.c -+++ b/src/cairo-ft-font.c -@@ -2393,7 +2393,11 @@ skip: - done: - free (coords); - free (current_coords); -+#if HAVE_FT_DONE_MM_VAR -+ FT_Done_MM_Var (face->glyph->library, ft_mm_var); -+#else - free (ft_mm_var); -+#endif - } - } - --- -2.18.1 - diff --git a/main/cairo/cff-allow-empty-array-of-operands-for-certain-operat.patch b/main/cairo/cff-allow-empty-array-of-operands-for-certain-operat.patch deleted file mode 100644 index 3149dadba6..0000000000 --- a/main/cairo/cff-allow-empty-array-of-operands-for-certain-operat.patch +++ /dev/null @@ -1,119 +0,0 @@ -From ef959bc76e65ea0b0d4ba3ee50dfbce31c3484ad Mon Sep 17 00:00:00 2001 -From: Marek Kasik <mkasik@redhat.com> -Date: Fri, 27 Mar 2020 19:39:46 +0100 -Subject: [PATCH] cff: Allow empty array of operands for certain operators - -Operators BlueValues, OtherBlues, FamilyBlues, FamilyOtherBlues, -StemSnapH and StemSnapV have operands of type delta which can be -a number or an array of delta-encoded numbers. This array can be -empty according to freetype developers. -This commit checks whether current operator is among those listed -and permits empty operand in such case. ---- - src/cairo-cff-subset.c | 78 ++++++++++++++++++++++++++---------------- - 1 file changed, 49 insertions(+), 29 deletions(-) - -Patch-Source: https://src.fedoraproject.org/rpms/cairo/blob/ba42ecc23bb1162a1951edc0209f9f48e87bba7e/f/0001-cff-Allow-empty-array-of-operands-for-certain-operat.patch -See-Also: https://bugzilla.redhat.com/show_bug.cgi?id=1817958 - -diff --git a/src/cairo-cff-subset.c b/src/cairo-cff-subset.c -index 37727eddb..fce4195e9 100644 ---- a/src/cairo-cff-subset.c -+++ b/src/cairo-cff-subset.c -@@ -56,30 +56,36 @@ - - /* CFF Dict Operators. If the high byte is 0 the command is encoded - * with a single byte. */ --#define BASEFONTNAME_OP 0x0c16 --#define CIDCOUNT_OP 0x0c22 --#define CHARSET_OP 0x000f --#define CHARSTRINGS_OP 0x0011 --#define COPYRIGHT_OP 0x0c00 --#define DEFAULTWIDTH_OP 0x0014 --#define ENCODING_OP 0x0010 --#define FAMILYNAME_OP 0x0003 --#define FDARRAY_OP 0x0c24 --#define FDSELECT_OP 0x0c25 --#define FONTBBOX_OP 0x0005 --#define FONTMATRIX_OP 0x0c07 --#define FONTNAME_OP 0x0c26 --#define FULLNAME_OP 0x0002 --#define LOCAL_SUB_OP 0x0013 --#define NOMINALWIDTH_OP 0x0015 --#define NOTICE_OP 0x0001 --#define POSTSCRIPT_OP 0x0c15 --#define PRIVATE_OP 0x0012 --#define ROS_OP 0x0c1e --#define UNIQUEID_OP 0x000d --#define VERSION_OP 0x0000 --#define WEIGHT_OP 0x0004 --#define XUID_OP 0x000e -+#define BASEFONTNAME_OP 0x0c16 -+#define CIDCOUNT_OP 0x0c22 -+#define CHARSET_OP 0x000f -+#define CHARSTRINGS_OP 0x0011 -+#define COPYRIGHT_OP 0x0c00 -+#define DEFAULTWIDTH_OP 0x0014 -+#define ENCODING_OP 0x0010 -+#define FAMILYNAME_OP 0x0003 -+#define FDARRAY_OP 0x0c24 -+#define FDSELECT_OP 0x0c25 -+#define FONTBBOX_OP 0x0005 -+#define FONTMATRIX_OP 0x0c07 -+#define FONTNAME_OP 0x0c26 -+#define FULLNAME_OP 0x0002 -+#define LOCAL_SUB_OP 0x0013 -+#define NOMINALWIDTH_OP 0x0015 -+#define NOTICE_OP 0x0001 -+#define POSTSCRIPT_OP 0x0c15 -+#define PRIVATE_OP 0x0012 -+#define ROS_OP 0x0c1e -+#define UNIQUEID_OP 0x000d -+#define VERSION_OP 0x0000 -+#define WEIGHT_OP 0x0004 -+#define XUID_OP 0x000e -+#define BLUEVALUES_OP 0x0006 -+#define OTHERBLUES_OP 0x0007 -+#define FAMILYBLUES_OP 0x0008 -+#define FAMILYOTHERBLUES_OP 0x0009 -+#define STEMSNAPH_OP 0x0c0c -+#define STEMSNAPV_OP 0x0c0d - - #define NUM_STD_STRINGS 391 - -@@ -615,13 +621,27 @@ cff_dict_create_operator (int operator, - return _cairo_error (CAIRO_STATUS_NO_MEMORY); - - _cairo_dict_init_key (op, operator); -- op->operand = _cairo_malloc (size); -- if (unlikely (op->operand == NULL)) { -- free (op); -- return _cairo_error (CAIRO_STATUS_NO_MEMORY); -+ if (size != 0) { -+ op->operand = _cairo_malloc (size); -+ if (unlikely (op->operand == NULL)) { -+ free (op); -+ return _cairo_error (CAIRO_STATUS_NO_MEMORY); -+ } -+ memcpy (op->operand, operand, size); -+ } else { -+ op->operand = NULL; -+ /* Delta-encoded arrays can be empty. */ -+ if (operator != BLUEVALUES_OP && -+ operator != OTHERBLUES_OP && -+ operator != FAMILYBLUES_OP && -+ operator != FAMILYOTHERBLUES_OP && -+ operator != STEMSNAPH_OP && -+ operator != STEMSNAPV_OP) { -+ free (op); -+ return _cairo_error (CAIRO_STATUS_NO_MEMORY); -+ } - } - -- memcpy (op->operand, operand, size); - op->operand_length = size; - op->operand_offset = -1; - --- -2.26.0 - diff --git a/main/cairo/composite_color_glyphs.patch b/main/cairo/composite_color_glyphs.patch deleted file mode 100644 index 97440f27f7..0000000000 --- a/main/cairo/composite_color_glyphs.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 79ad01724161502e8d9d2bd384ff1f0174e5df6e Mon Sep 17 00:00:00 2001 -From: Matthias Clasen <mclasen@redhat.com> -Date: Thu, 30 May 2019 07:30:55 -0400 -Subject: [PATCH] Fix a thinko in composite_color_glyphs - -We can't just move around the contents of the -passed-in string, we need to make a copy. This -was showing up as memory corruption in pango. - -See https://gitlab.gnome.org/GNOME/pango/issues/346 ---- - src/cairo-surface.c | 10 ++++++++++ - 1 file changed, 10 insertions(+) - -Patch-Source: https://github.com/matthiasclasen/cairo/commit/79ad01724161502e8d9d2bd384ff1f0174e5df6e - -diff --git a/src/cairo-surface.c b/src/cairo-surface.c -index c30f84087..e112b660a 100644 ---- a/src/cairo-surface.c -+++ b/src/cairo-surface.c -@@ -2820,6 +2820,7 @@ _cairo_surface_show_text_glyphs (cairo_surface_t *surface, - const cairo_clip_t *clip) - { - cairo_int_status_t status; -+ char *utf8_copy = NULL; - - TRACE ((stderr, "%s\n", __FUNCTION__)); - if (unlikely (surface->status)) -@@ -2847,6 +2848,10 @@ _cairo_surface_show_text_glyphs (cairo_surface_t *surface, - status = CAIRO_INT_STATUS_UNSUPPORTED; - - if (_cairo_scaled_font_has_color_glyphs (scaled_font)) { -+ utf8_copy = malloc (sizeof (char) * utf8_len); -+ memcpy (utf8_copy, utf8, sizeof (char) * utf8_len); -+ utf8 = utf8_copy; -+ - status = composite_color_glyphs (surface, op, - source, - (char *)utf8, &utf8_len, -@@ -2861,6 +2866,8 @@ _cairo_surface_show_text_glyphs (cairo_surface_t *surface, - if (num_glyphs == 0) - goto DONE; - } -+ else -+ utf8_copy = NULL; - - /* The logic here is duplicated in _cairo_analysis_surface show_glyphs and - * show_text_glyphs. Keep in synch. */ -@@ -2918,6 +2925,9 @@ _cairo_surface_show_text_glyphs (cairo_surface_t *surface, - surface->serial++; - } - -+ if (utf8_copy) -+ free (utf8_copy); -+ - return _cairo_surface_set_error (surface, status); - } - diff --git a/main/cairo/pdf-flush.patch b/main/cairo/pdf-flush.patch deleted file mode 100644 index c6e2251a51..0000000000 --- a/main/cairo/pdf-flush.patch +++ /dev/null @@ -1,33 +0,0 @@ -From https://cgit.freedesktop.org/cairo/commit/?id=4c8813f0eaacc32c27126ad2296951a626300b89 - -Fixes https://gitlab.freedesktop.org/cairo/cairo/issues/342 - -From 4c8813f0eaacc32c27126ad2296951a626300b89 Mon Sep 17 00:00:00 2001 -From: Adrian Johnson <ajohnson@redneon.com> -Date: Thu, 25 Oct 2018 18:46:17 +1030 -Subject: pdf: add missing flush - -Issue #342 ---- - src/cairo-pdf-surface.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c -index 7eb61aa..939b2d2 100644 ---- a/src/cairo-pdf-surface.c -+++ b/src/cairo-pdf-surface.c -@@ -7711,6 +7711,11 @@ _cairo_pdf_surface_mask (void *abstract_surface, - * and most common, case to handle. */ - if (_cairo_pattern_is_constant_alpha (mask, &extents.bounded, &alpha) && - _can_paint_pattern (source)) { -+ -+ status = _cairo_pdf_operators_flush (&surface->pdf_operators); -+ if (unlikely (status)) -+ goto cleanup; -+ - _cairo_output_stream_printf (surface->output, "q\n"); - status = _cairo_pdf_surface_paint_pattern (surface, - op, --- -cgit v1.1 - diff --git a/main/cairo/pdf-font-subset-Generate-valid-font-names.patch b/main/cairo/pdf-font-subset-Generate-valid-font-names.patch new file mode 100644 index 0000000000..d5cfe2f227 --- /dev/null +++ b/main/cairo/pdf-font-subset-Generate-valid-font-names.patch @@ -0,0 +1,58 @@ +From a3b69a0215fdface0fd5730872a4b3242d979dca Mon Sep 17 00:00:00 2001 +From: Uli Schlachter <psychon@znc.in> +Date: Tue, 9 Feb 2021 16:54:35 +0100 +Subject: [PATCH] pdf font subset: Generate valid font names + +A hash value is encoded in base 26 with upper case letters for font +names. + +Commit ed984146 replaced "numerator = abs (hash);" with "numerator = +hash;" in this code, because hash has type uint32_t and the compiler +warned about taking the absolute value of an unsigned value. However, +abs() is actually defined to take an int argument. Thus, there was some +implicit cast. + +Since numerator has type long, i.e. is signed, it is now actually +possible to get an overflow in the implicit cast and then have a +negative number. The following code is not prepared for this and +produces non-letters when encoding the hash. + +This commit fixes that problem by not using ldiv() and instead using / +and % to directly compute the needed values. This gets rid of the need +to convert to type long. Since now everything works with uint32_t, there +is no more chance for negative numbers messing things up. + +Fixes: https://gitlab.freedesktop.org/cairo/cairo/-/issues/449 +Signed-off-by: Uli Schlachter <psychon@znc.in> +--- + src/cairo-pdf-surface.c | 8 ++------ + 1 file changed, 2 insertions(+), 6 deletions(-) + +diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c +index 6da460878..52c49b6d2 100644 +--- a/src/cairo-pdf-surface.c ++++ b/src/cairo-pdf-surface.c +@@ -5310,18 +5310,14 @@ _create_font_subset_tag (cairo_scaled_font_subset_t *font_subset, + { + uint32_t hash; + int i; +- long numerator; +- ldiv_t d; + + hash = _hash_data ((unsigned char *) font_name, strlen(font_name), 0); + hash = _hash_data ((unsigned char *) (font_subset->glyphs), + font_subset->num_glyphs * sizeof(unsigned long), hash); + +- numerator = hash; + for (i = 0; i < 6; i++) { +- d = ldiv (numerator, 26); +- numerator = d.quot; +- tag[i] = 'A' + d.rem; ++ tag[i] = 'A' + (hash % 26); ++ hash /= 26; + } + tag[i] = 0; + } +-- +GitLab + |