summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2018-02-02 15:53:25 -0500
committerBehdad Esfahbod <behdad@behdad.org>2018-02-04 12:36:54 -0500
commitfe5f9b1ae318939eaa23d0175a5eb7e1739177ac (patch)
tree88397b4db5ddc7442f5aa33d62ce85c7decc3ad6
parentcf943f682bcdd73e3ad1f6108c1a1870b991d5e4 (diff)
[aat] Fix ContextualSubtable sanitization
Fixes MORX-18, MORX-19, and MORX-22.
-rw-r--r--src/hb-aat-layout-morx-table.hh6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/hb-aat-layout-morx-table.hh b/src/hb-aat-layout-morx-table.hh
index c64dca06..7a45a24e 100644
--- a/src/hb-aat-layout-morx-table.hh
+++ b/src/hb-aat-layout-morx-table.hh
@@ -275,8 +275,10 @@ struct ContextualSubtable
{
const EntryData &data = entries[i].data;
- num_lookups = MAX<unsigned int> (num_lookups, 1 + data.markIndex);
- num_lookups = MAX<unsigned int> (num_lookups, 1 + data.currentIndex);
+ if (data.markIndex != 0xFFFF)
+ num_lookups = MAX<unsigned int> (num_lookups, 1 + data.markIndex);
+ if (data.currentIndex != 0xFFFF)
+ num_lookups = MAX<unsigned int> (num_lookups, 1 + data.currentIndex);
}
return_trace (substitutionTables.sanitize (c, this, num_lookups));