src/hb-ot-hmtx-table.hh              |    4 ++--
 src/hb-ot-layout-gsubgpos-private.hh |   10 +++++-----
 2 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 6d7c6e19dc769cf9997b7c1f8a4598eb44ca0b3c
Author: Behdad Esfahbod <[email protected]>
Date:   Wed Feb 7 14:09:56 2018 -0600

    Fix two undefined-behavior issues
    
    Fixes https://github.com/harfbuzz/harfbuzz/issues/761
    Fixes https://github.com/harfbuzz/harfbuzz/issues/762

diff --git a/src/hb-ot-hmtx-table.hh b/src/hb-ot-hmtx-table.hh
index 934acde7..eed48902 100644
--- a/src/hb-ot-hmtx-table.hh
+++ b/src/hb-ot-hmtx-table.hh
@@ -173,7 +173,7 @@ struct hmtxvmtx
                                         * be in the array, but that entry is
                                         * required. The last entry applies to
                                         * all subsequent glyphs. */
-  FWORD                leadingBearingX[VAR];   /* Here the advance is assumed
+/*FWORD                leadingBearingX[VAR];*/ /* Here the advance is assumed
                                         * to be the same as the advance
                                         * for the last entry above. The
                                         * number of entries in this array is
@@ -187,7 +187,7 @@ struct hmtxvmtx
                                         * font to vary the side bearing
                                         * values for each glyph. */
   public:
-  DEFINE_SIZE_ARRAY2 (0, longMetric, leadingBearingX);
+  DEFINE_SIZE_ARRAY (0, longMetric);
 };
 
 struct hmtx : hmtxvmtx<hmtx> {
diff --git a/src/hb-ot-layout-gsubgpos-private.hh 
b/src/hb-ot-layout-gsubgpos-private.hh
index 8a005f5a..90546344 100644
--- a/src/hb-ot-layout-gsubgpos-private.hh
+++ b/src/hb-ot-layout-gsubgpos-private.hh
@@ -1212,7 +1212,7 @@ struct Rule
                  lookupCount.sanitize (c) &&
                  c->check_range (inputZ,
                                  inputZ[0].static_size * inputCount +
-                                 lookupRecordX[0].static_size * lookupCount));
+                                 LookupRecord::static_size * lookupCount));
   }
 
   protected:
@@ -1222,10 +1222,10 @@ struct Rule
   HBUINT16     lookupCount;            /* Number of LookupRecords */
   HBUINT16     inputZ[VAR];            /* Array of match inputs--start with
                                         * second glyph */
-  LookupRecord lookupRecordX[VAR];     /* Array of LookupRecords--in
+/*LookupRecord lookupRecordX[VAR];*/   /* Array of LookupRecords--in
                                         * design order */
   public:
-  DEFINE_SIZE_ARRAY2 (4, inputZ, lookupRecordX);
+  DEFINE_SIZE_ARRAY (4, inputZ);
 };
 
 struct RuleSet
@@ -1556,10 +1556,10 @@ struct ContextFormat3
   OffsetTo<Coverage>
                coverageZ[VAR];         /* Array of offsets to Coverage
                                         * table in glyph sequence order */
-  LookupRecord lookupRecordX[VAR];     /* Array of LookupRecords--in
+/*LookupRecord lookupRecordX[VAR];*/   /* Array of LookupRecords--in
                                         * design order */
   public:
-  DEFINE_SIZE_ARRAY2 (6, coverageZ, lookupRecordX);
+  DEFINE_SIZE_ARRAY (6, coverageZ);
 };
 
 struct Context
_______________________________________________
HarfBuzz mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/harfbuzz

Reply via email to