Blame SOURCES/freetype-2.8-avar-table-load.patch

b3c194
From 55bbb98f5c5a89230127d6b998a6e23e634b5d0e Mon Sep 17 00:00:00 2001
b3c194
From: Behdad Esfahbod <behdad@behdad.org>
b3c194
Date: Tue, 1 Aug 2017 09:17:02 +0200
b3c194
Subject: [PATCH 077/132] [truetype] Fix loading of named instances.
b3c194
b3c194
* src/truetype/ttgxvar.c (TT_Get_MM_Var): Preserve file position
b3c194
while loading the `avar' table.
b3c194
---
b3c194
 ChangeLog               |  7 +++++++
b3c194
 include/freetype/ftmm.h |  2 +-
b3c194
 src/truetype/ttgxvar.c  | 11 ++++++++++-
b3c194
 3 files changed, 18 insertions(+), 2 deletions(-)
b3c194
b3c194
diff --git a/src/truetype/ttgxvar.c b/src/truetype/ttgxvar.c
b3c194
index 68458362e..df42b3bfd 100644
b3c194
--- a/src/truetype/ttgxvar.c
b3c194
+++ b/src/truetype/ttgxvar.c
b3c194
@@ -2136,8 +2136,16 @@
b3c194
         goto Exit;
b3c194
 
b3c194
       if ( fvar_head.instanceCount && !face->blend->avar_loaded )
b3c194
+      {
b3c194
+        FT_ULong  offset = FT_STREAM_POS();
b3c194
+
b3c194
+
b3c194
         ft_var_load_avar( face );
b3c194
 
b3c194
+        if ( FT_STREAM_SEEK( offset ) )
b3c194
+          goto Exit;
b3c194
+      }
b3c194
+
b3c194
       ns  = mmvar->namedstyle;
b3c194
       nsc = face->blend->normalized_stylecoords;
b3c194
       for ( i = 0; i < fvar_head.instanceCount; i++, ns++ )
b3c194
@@ -2171,7 +2179,7 @@
b3c194
         SFNT_Service  sfnt = (SFNT_Service)face->sfnt;
b3c194
 
b3c194
         FT_Int   found, dummy1, dummy2;
b3c194
-        FT_UInt  strid = 0xFFFFFFFFUL;
b3c194
+        FT_UInt  strid = ~0U;
b3c194
 
b3c194
 
b3c194
         /* the default instance is missing in array the   */
b3c194
-- 
b3c194
2.13.5
b3c194