From: Behdad Esfahbod Date: Fri, 14 Sep 2018 16:59:53 +0000 (+0200) Subject: [dfont] Disable null-processsing for offsets X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f8ccb545c47abe8f0f4ed318ff7b5bf176913893;p=platform%2Fupstream%2FlibHarfBuzzSharp.git [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 38610a8..8772c79 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 > + OffsetTo, 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 > + OffsetTo, 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 > + LOffsetTo, false> data; /* Offset from beginning of resource fork * to resource data */ - LOffsetTo + LOffsetTo 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 4f16c7d..2e1e240 100644 --- a/src/hb-open-type.hh +++ b/src/hb-open-type.hh @@ -311,7 +311,7 @@ struct OffsetTo : Offset } DEFINE_SIZE_STATIC (sizeof(OffsetType)); }; -template struct LOffsetTo : OffsetTo {}; +template struct LOffsetTo : OffsetTo {}; template static inline const Type& operator + (const Base &base, const OffsetTo &offset) { return offset (base); } template