[packages/cairo] - added ft-Use-FT_Done_MM_Var-instead-of-free-when-available,composite_color_glyphs patches from Fed

qboosh qboosh at pld-linux.org
Mon Jul 29 21:41:20 CEST 2019


commit 231435679b36d5ea67be207fbe4de3a62ae1e473
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Mon Jul 29 21:43:18 2019 +0200

    - added ft-Use-FT_Done_MM_Var-instead-of-free-when-available,composite_color_glyphs patches from Fedora; release 4

 cairo-composite_color_glyphs.patch                 | 56 ++++++++++++++++++++++
 ...one_MM_Var-instead-of-free-when-available.patch | 30 ++++++++++++
 cairo.spec                                         |  6 ++-
 3 files changed, 91 insertions(+), 1 deletion(-)
---
diff --git a/cairo.spec b/cairo.spec
index 2d96cf2..80f04e9 100644
--- a/cairo.spec
+++ b/cairo.spec
@@ -29,13 +29,15 @@ Summary:	Cairo - multi-platform 2D graphics library
 Summary(pl.UTF-8):	Cairo - wieloplatformowa biblioteka graficzna 2D
 Name:		cairo
 Version:	1.16.0
-Release:	3
+Release:	4
 License:	LGPL v2.1 or MPL v1.1
 Group:		Libraries
 Source0:	https://www.cairographics.org/releases/%{name}-%{version}.tar.xz
 # Source0-md5:	f19e0353828269c22bd72e271243a552
 Patch0:		%{name}-link.patch
 Patch1:		%{name}-gobject-deps.patch
+Patch2:		%{name}-ft-Use-FT_Done_MM_Var-instead-of-free-when-available.patch
+Patch3:		%{name}-composite_color_glyphs.patch
 URL:		https://www.cairographics.org/
 %{?with_directfb:BuildRequires:	DirectFB-devel}
 %if %{with gl} || %{with glesv2} || %{with glesv3} || %{with openvg}
@@ -247,6 +249,8 @@ Dokumentacja API Cairo.
 %setup -q
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
+%patch3 -p1
 
 %if %{without tests}
 %{__sed} -i -e '/SUBDIRS += boilerplate test perf/d' Makefile.am
diff --git a/cairo-composite_color_glyphs.patch b/cairo-composite_color_glyphs.patch
new file mode 100644
index 0000000..fe8860e
--- /dev/null
+++ b/cairo-composite_color_glyphs.patch
@@ -0,0 +1,56 @@
+From 79ad01724161502e8d9d2bd384ff1f0174e5df6e Mon Sep 17 00:00:00 2001
+From: Matthias Clasen <mclasen at 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(+)
+
+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/cairo-ft-Use-FT_Done_MM_Var-instead-of-free-when-available.patch b/cairo-ft-Use-FT_Done_MM_Var-instead-of-free-when-available.patch
new file mode 100644
index 0000000..3709c5a
--- /dev/null
+++ b/cairo-ft-Use-FT_Done_MM_Var-instead-of-free-when-available.patch
@@ -0,0 +1,30 @@
+From 90e85c2493fdfa3551f202ff10282463f1e36645 Mon Sep 17 00:00:00 2001
+From: Carlos Garcia Campos <cgarcia at 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.19.2
+
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/cairo.git/commitdiff/231435679b36d5ea67be207fbe4de3a62ae1e473



More information about the pld-cvs-commit mailing list