From 602fbfe3c96b3f18b0109239528ba18a19be4948 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 12 Dec 2018 09:56:47 -0500 Subject: [PATCH] [sanitize] Fix sanitizing sublookup array --- src/hb-ot-layout-common.hh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/hb-ot-layout-common.hh b/src/hb-ot-layout-common.hh index cc1af157..fd64c924 100644 --- a/src/hb-ot-layout-common.hh +++ b/src/hb-ot-layout-common.hh @@ -760,6 +760,14 @@ struct Lookup return_trace (true); } + /* Older compilers need this to NOT be locally defined in a function. */ + template + struct SubTableSanitizeWrapper : TSubTable + { + inline bool sanitize (hb_sanitize_context_t *c, unsigned int lookup_type) const + { return this->dispatch (c, lookup_type); } + }; + template inline bool sanitize (hb_sanitize_context_t *c) const { @@ -771,7 +779,9 @@ struct Lookup if (!markFilteringSet.sanitize (c)) return_trace (false); } - if (unlikely (!dispatch (c))) return_trace (false); + if (unlikely (!CastR > > (subTable) + .sanitize (c, this, get_type ()))) + return_trace (false); if (unlikely (get_type () == TSubTable::Extension)) { -- GitLab