[HarfBuzz] harfbuzz: Branch 'master'
Behdad Esfahbod
behdad at kemper.freedesktop.org
Wed Nov 28 20:24:50 UTC 2018
src/hb-aat-layout-common.hh | 14 ++++++++++++++
src/hb-aat-layout-kerx-table.hh | 2 +-
2 files changed, 15 insertions(+), 1 deletion(-)
New commits:
commit 42a2b496e428521151ff5cb07454d2e993f892cc
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Wed Nov 28 15:24:30 2018 -0500
[kerx] Fix Format2 index calc again
diff --git a/src/hb-aat-layout-common.hh b/src/hb-aat-layout-common.hh
index 253b56fe..c0b0e375 100644
--- a/src/hb-aat-layout-common.hh
+++ b/src/hb-aat-layout-common.hh
@@ -689,6 +689,13 @@ struct ObsoleteTypes
return (offset - ((const char *) array - (const char *) base)) / sizeof (T);
}
template <typename T>
+ static inline unsigned int byteOffsetToIndex (unsigned int offset,
+ const void *base,
+ const T *array)
+ {
+ return offsetToIndex (offset, base, array);
+ }
+ template <typename T>
static inline unsigned int wordOffsetToIndex (unsigned int offset,
const void *base,
const T *array)
@@ -712,6 +719,13 @@ struct ExtendedTypes
return offset;
}
template <typename T>
+ static inline unsigned int byteOffsetToIndex (unsigned int offset,
+ const void *base,
+ const T *array)
+ {
+ return offset / 2;
+ }
+ template <typename T>
static inline unsigned int wordOffsetToIndex (unsigned int offset,
const void *base,
const T *array)
diff --git a/src/hb-aat-layout-kerx-table.hh b/src/hb-aat-layout-kerx-table.hh
index abd577b9..7caf45d5 100644
--- a/src/hb-aat-layout-kerx-table.hh
+++ b/src/hb-aat-layout-kerx-table.hh
@@ -255,7 +255,7 @@ struct KerxSubTableFormat1
unsigned int tuple_count = MAX (1u, table->header.tuple_count ());
unsigned int kern_idx = Format1EntryT::kernActionIndex (entry);
- kern_idx = Types::offsetToIndex (kern_idx, &table->machine, kernAction.arrayZ);
+ kern_idx = Types::byteOffsetToIndex (kern_idx, &table->machine, kernAction.arrayZ);
const FWORD *actions = &kernAction[kern_idx];
if (!c->sanitizer.check_array (actions, depth, tuple_count))
{
More information about the HarfBuzz
mailing list