diff --git a/src/hb-aat-layout-common.hh b/src/hb-aat-layout-common.hh index a8c4b7637..e4851ce08 100644 --- a/src/hb-aat-layout-common.hh +++ b/src/hb-aat-layout-common.hh @@ -678,7 +678,7 @@ struct ObsoleteTypes const void *base, const T *array) { - return (offset - ((const char *) array - (const char *) base)) / sizeof (T); + return (offset - ((const char *) array - (const char *) base)) / T::static_size; } template static unsigned int byteOffsetToIndex (unsigned int offset, diff --git a/src/hb-aat-layout-kerx-table.hh b/src/hb-aat-layout-kerx-table.hh index 25de8c6c0..c1d8815ae 100644 --- a/src/hb-aat-layout-kerx-table.hh +++ b/src/hb-aat-layout-kerx-table.hh @@ -392,7 +392,7 @@ struct KerxSubTableFormat2 const UnsizedArrayOf &arrayZ = this+array; unsigned int kern_idx = l + r; - kern_idx = Types::offsetToIndex (kern_idx, this, &arrayZ); + kern_idx = Types::offsetToIndex (kern_idx, this, arrayZ.arrayZ); const FWORD *v = &arrayZ[kern_idx]; if (unlikely (!v->sanitize (&c->sanitizer))) return 0;