[152719] trunk/dports/graphics/fontconfig
ryandesign at macports.org
ryandesign at macports.org
Thu Sep 15 04:06:06 PDT 2016
Revision: 152719
https://trac.macports.org/changeset/152719
Author: ryandesign at macports.org
Date: 2016-09-15 04:06:06 -0700 (Thu, 15 Sep 2016)
Log Message:
-----------
fontconfig: fix cache validation bug
This caused the cache to always be considered invalid and regenerated,
leading to performance problems.
Should resolve #52029 #52088 #52099
Modified Paths:
--------------
trunk/dports/graphics/fontconfig/Portfile
trunk/dports/graphics/fontconfig/files/patch-src-fcweight.c.diff
Added Paths:
-----------
trunk/dports/graphics/fontconfig/files/patch-src-fccache.c.diff
Modified: trunk/dports/graphics/fontconfig/Portfile
===================================================================
--- trunk/dports/graphics/fontconfig/Portfile 2016-09-15 11:04:11 UTC (rev 152718)
+++ trunk/dports/graphics/fontconfig/Portfile 2016-09-15 11:06:06 UTC (rev 152719)
@@ -6,6 +6,7 @@
name fontconfig
version 2.12.1
+revision 1
categories graphics
maintainers ryandesign
license fontconfig
@@ -39,9 +40,8 @@
set docdir ${prefix}/share/doc/${name}
patchfiles patch-docbook-4.2.diff
-
-# https://bugs.freedesktop.org/show_bug.cgi?id=96609
patchfiles-append patch-src-fcweight.c.diff
+patchfiles-append patch-src-fccache.c.diff
configure.args --disable-silent-rules HASDOCBOOK=no
Added: trunk/dports/graphics/fontconfig/files/patch-src-fccache.c.diff
===================================================================
--- trunk/dports/graphics/fontconfig/files/patch-src-fccache.c.diff (rev 0)
+++ trunk/dports/graphics/fontconfig/files/patch-src-fccache.c.diff 2016-09-15 11:06:06 UTC (rev 152719)
@@ -0,0 +1,37 @@
+Validate cache correctly
+https://bugs.freedesktop.org/show_bug.cgi?id=97546
+--- src/fccache.c.orig
++++ src/fccache.c
+@@ -640,6 +640,8 @@ FcCacheOffsetsValid (FcCache *cache)
+ FcPattern *font = FcFontSetFont (fs, i);
+ FcPatternElt *e;
+ FcValueListPtr l;
++ ssize_t c;
++ char *begin;
+
+ if ((char *) font < base ||
+ (char *) font > end - sizeof (FcFontSet) ||
+@@ -653,11 +655,18 @@ FcCacheOffsetsValid (FcCache *cache)
+ if (e->values != 0 && !FcIsEncodedOffset(e->values))
+ return FcFalse;
+
+- for (j = font->num, l = FcPatternEltValues(e); j >= 0 && l; j--, l = FcValueListNext(l))
+- if (l->next != NULL && !FcIsEncodedOffset(l->next))
+- break;
+- if (j < 0)
+- return FcFalse;
++ for (j = 0; j < font->num; j++)
++ {
++ begin = (char *)FcPatternEltValues(&e[j]);
++ c = (end - begin) / sizeof (FcValueList);
++ for (l = FcPatternEltValues(&e[j]); l; l = FcValueListNext(l))
++ {
++ if ((char *) l < begin || (char *)l > end - sizeof (*l) ||
++ (l->next != NULL && !FcIsEncodedOffset(l->next)) ||
++ c-- <= 0)
++ return FcFalse;
++ }
++ }
+ }
+ }
+
Modified: trunk/dports/graphics/fontconfig/files/patch-src-fcweight.c.diff
===================================================================
--- trunk/dports/graphics/fontconfig/files/patch-src-fcweight.c.diff 2016-09-15 11:04:11 UTC (rev 152718)
+++ trunk/dports/graphics/fontconfig/files/patch-src-fcweight.c.diff 2016-09-15 11:06:06 UTC (rev 152719)
@@ -1,4 +1,5 @@
Revert a 2.12 change in fcweight.c that introduced a bug
+https://bugs.freedesktop.org/show_bug.cgi?id=96609
--- src/fcweight.c.orig 2016-07-01 14:58:33.000000000 -0400
+++ src/fcweight.c 2016-07-01 14:58:56.000000000 -0400
@@ -56,7 +56,7 @@
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20160915/b1f21a4c/attachment-0001.html>
More information about the macports-changes
mailing list