[HarfBuzz] harfbuzz: Branch 'master'

Behdad Esfahbod behdad at kemper.freedesktop.org
Fri Sep 14 17:01:22 UTC 2018


 src/hb-open-file.hh |    8 ++++----
 src/hb-open-type.hh |    2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit f8ccb545c47abe8f0f4ed318ff7b5bf176913893
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Fri Sep 14 18:59:53 2018 +0200

    [dfont] Disable null-processsing for offsets
    
    An offset to unsized arrayis not safe to be redirected to our fixed-sized
    null pool.  Plus, we want to reject, not repair, bad-looking dfonts.

diff --git a/src/hb-open-file.hh b/src/hb-open-file.hh
index 38610a8e..8772c79f 100644
--- a/src/hb-open-file.hh
+++ b/src/hb-open-file.hh
@@ -348,7 +348,7 @@ struct ResourceTypeRecord
   protected:
   Tag		tag;		/* Resource type. */
   HBUINT16	resCountM1;	/* Number of resources minus 1. */
-  OffsetTo<UnsizedArrayOf<ResourceRecord> >
+  OffsetTo<UnsizedArrayOf<ResourceRecord>, HBUINT16, false>
 		resourcesZ;	/* Offset from beginning of resource type list
 				 * to reference item list for this type. */
   public:
@@ -404,7 +404,7 @@ struct ResourceMap
   HBUINT32	reserved1;	/* Reserved for handle to next resource map */
   HBUINT16	resreved2;	/* Reserved for file reference number */
   HBUINT16	attrs;		/* Resource fork attribute */
-  OffsetTo<ArrayOfM1<ResourceTypeRecord> >
+  OffsetTo<ArrayOfM1<ResourceTypeRecord>, HBUINT16, false>
 		typeList;	/* Offset from beginning of map to
 				 * resource type list */
   Offset16	nameList;	/* Offset from beginning of map to
@@ -436,10 +436,10 @@ struct ResourceForkHeader
   }
 
   protected:
-  LOffsetTo<UnsizedArrayOf<HBUINT8> >
+  LOffsetTo<UnsizedArrayOf<HBUINT8>, false>
 		data;		/* Offset from beginning of resource fork
 				 * to resource data */
-  LOffsetTo<ResourceMap>
+  LOffsetTo<ResourceMap, false>
 		map;		/* Offset from beginning of resource fork
 				 * to resource map */
   HBUINT32	dataLen;	/* Length of resource data */
diff --git a/src/hb-open-type.hh b/src/hb-open-type.hh
index 4f16c7d3..2e1e240c 100644
--- a/src/hb-open-type.hh
+++ b/src/hb-open-type.hh
@@ -311,7 +311,7 @@ struct OffsetTo : Offset<OffsetType, has_null>
   }
   DEFINE_SIZE_STATIC (sizeof(OffsetType));
 };
-template <typename Type> struct LOffsetTo : OffsetTo<Type, HBUINT32> {};
+template <typename Type, bool has_null=true> struct LOffsetTo : OffsetTo<Type, HBUINT32, has_null> {};
 template <typename Base, typename OffsetType, bool has_null, typename Type>
 static inline const Type& operator + (const Base &base, const OffsetTo<Type, OffsetType, has_null> &offset) { return offset (base); }
 template <typename Base, typename OffsetType, bool has_null, typename Type>


More information about the HarfBuzz mailing list