diff --git a/src/hb-cff2-interp-cs.hh b/src/hb-cff2-interp-cs.hh index 672e67c94..ef680f0e9 100644 --- a/src/hb-cff2-interp-cs.hh +++ b/src/hb-cff2-interp-cs.hh @@ -247,6 +247,7 @@ struct CFF2CSOpSet : CSOpSet static inline void process_vsindex (CFF2CSInterpEnv &env, PARAM& param) { env.process_vsindex (); + env.clear_args (); } private: diff --git a/src/hb-ot-cff1-table.hh b/src/hb-ot-cff1-table.hh index bc67e49b5..820404ed6 100644 --- a/src/hb-ot-cff1-table.hh +++ b/src/hb-ot-cff1-table.hh @@ -64,6 +64,8 @@ struct Encoding0 { inline hb_codepoint_t get_code (hb_codepoint_t glyph) const { + assert (glyph > 0); + glyph--; if (glyph < nCodes) { return (hb_codepoint_t)codes[glyph]; @@ -106,6 +108,8 @@ struct Encoding1 { inline hb_codepoint_t get_code (hb_codepoint_t glyph) const { + assert (glyph > 0); + glyph--; for (unsigned int i = 0; i < nRanges; i++) { if (glyph <= ranges[i].nLeft) diff --git a/src/hb-ot-cff2-table.hh b/src/hb-ot-cff2-table.hh index 04d9e2b38..1b01c1cfe 100644 --- a/src/hb-ot-cff2-table.hh +++ b/src/hb-ot-cff2-table.hh @@ -347,6 +347,7 @@ struct CFF2PrivateDictOpSet : DictOpSet case OpCode_vsindexdict: env.process_vsindex (); dictval.ivs = env.get_ivs (); + env.clear_args (); break; case OpCode_blenddict: break;