Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/graphics/cairo cairo: backport patches from upstream t...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/e9920dbdb217
branches:  trunk
changeset: 435574:e9920dbdb217
user:      leot <leot%pkgsrc.org@localhost>
date:      Thu Jul 09 14:38:55 2020 +0000

description:
cairo: backport patches from upstream to use FT_Done_MM_Var instead of free

Memory allocated via FT_Get_MM_Var should be freed via FT_Done_MM_Var since
freetype 2.9.  Backport patches from upstream to address missing parts not doing
that.

PKGREVISION++

diffstat:

 graphics/cairo/Makefile                          |   4 ++-
 graphics/cairo/distinfo                          |   3 +-
 graphics/cairo/patches/patch-src_cairo-ft-font.c |  34 ++++++++++++++++++++++++
 3 files changed, 39 insertions(+), 2 deletions(-)

diffs (66 lines):

diff -r ec3d2ade8c97 -r e9920dbdb217 graphics/cairo/Makefile
--- a/graphics/cairo/Makefile   Thu Jul 09 13:34:27 2020 +0000
+++ b/graphics/cairo/Makefile   Thu Jul 09 14:38:55 2020 +0000
@@ -1,7 +1,9 @@
-# $NetBSD: Makefile,v 1.145 2019/08/28 22:08:12 wiz Exp $
+# $NetBSD: Makefile,v 1.146 2020/07/09 14:38:55 leot Exp $
 
 .include "../../graphics/cairo/Makefile.common"
 
+PKGREVISION=   1
+
 TEST_TARGET=                   check
 
 .include "options.mk"
diff -r ec3d2ade8c97 -r e9920dbdb217 graphics/cairo/distinfo
--- a/graphics/cairo/distinfo   Thu Jul 09 13:34:27 2020 +0000
+++ b/graphics/cairo/distinfo   Thu Jul 09 14:38:55 2020 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.88 2018/11/14 17:14:52 kleink Exp $
+$NetBSD: distinfo,v 1.89 2020/07/09 14:38:55 leot Exp $
 
 SHA1 (cairo-1.16.0.tar.xz) = 00e81842ae5e81bb0343108884eb5205be0eac14
 RMD160 (cairo-1.16.0.tar.xz) = cfd2ef6ec55b267e04600f6b1e36bb07f2566b35
@@ -8,3 +8,4 @@
 SHA1 (patch-ab) = 11f7e0e59bd5c51a8fdacb48dcf2f2fefdf3b768
 SHA1 (patch-ac) = 1785bbef6bcab4781bf89e1b986a7eb96e5f2b64
 SHA1 (patch-ad) = a1068a37113b162ccfe14d7f1bd0baa9df7e5530
+SHA1 (patch-src_cairo-ft-font.c) = 97288d79380473869f1049c1d8955a2f6fa3d178
diff -r ec3d2ade8c97 -r e9920dbdb217 graphics/cairo/patches/patch-src_cairo-ft-font.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/cairo/patches/patch-src_cairo-ft-font.c  Thu Jul 09 14:38:55 2020 +0000
@@ -0,0 +1,34 @@
+$NetBSD: patch-src_cairo-ft-font.c,v 1.1 2020/07/09 14:38:55 leot Exp $
+
+Use FT_Done_MM_Var instead of free when available.
+
+Fixes possible crashes and memory leaks.
+
+Backport from upstream commits 90e85c24, a68c1968.
+
+--- src/cairo-ft-font.c.orig   2020-07-09 14:26:11.503421448 +0000
++++ src/cairo-ft-font.c
+@@ -459,6 +459,11 @@ _cairo_ft_unscaled_font_init (cairo_ft_u
+               unscaled->variations = calloc (ft_mm_var->num_axis, sizeof (FT_Fixed));
+               if (unscaled->variations)
+                   FT_Get_Var_Design_Coordinates (face, ft_mm_var->num_axis, unscaled->variations);
++#if HAVE_FT_DONE_MM_VAR
++              FT_Done_MM_Var (face->glyph->library, ft_mm_var);
++#else
++              free (ft_mm_var);
++#endif
+           }
+       }
+ #endif
+@@ -2393,7 +2398,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
+     }
+ }
+ 



Home | Main Index | Thread Index | Old Index