diff --git a/src/hb-cff-interp-common.hh b/src/hb-cff-interp-common.hh index 8a79c7afb..fa03d672a 100644 --- a/src/hb-cff-interp-common.hh +++ b/src/hb-cff-interp-common.hh @@ -327,13 +327,14 @@ struct byte_str_ref_t } } + unsigned get_offset () const { return offset; } + void set_error () { error = true; } bool in_error () const { return error; } + protected: hb_ubytes_t str; unsigned int offset; /* beginning of the sub-string within str */ - - protected: bool error; }; @@ -521,16 +522,16 @@ struct parsed_values_t { VAL *val = values.push (); val->op = op; - val->str = str_ref.sub_array (opStart, str_ref.offset - opStart); - opStart = str_ref.offset; + val->str = str_ref.sub_array (opStart, str_ref.get_offset () - opStart); + opStart = str_ref.get_offset (); } void add_op (op_code_t op, const byte_str_ref_t& str_ref, const VAL &v) { VAL *val = values.push (v); val->op = op; - val->str = str_ref.sub_array ( opStart, str_ref.offset - opStart); - opStart = str_ref.offset; + val->str = str_ref.sub_array (opStart, str_ref.get_offset () - opStart); + opStart = str_ref.get_offset (); } bool has_op (op_code_t op) const diff --git a/src/hb-ot-cff1-table.hh b/src/hb-ot-cff1-table.hh index 17b029661..007225c84 100644 --- a/src/hb-ot-cff1-table.hh +++ b/src/hb-ot-cff1-table.hh @@ -813,7 +813,7 @@ struct cff1_top_dict_opset_t : top_dict_opset_t break; default: - env.last_offset = env.str_ref.offset; + env.last_offset = env.str_ref.get_offset (); top_dict_opset_t::process_op (op, env, dictval); /* Record this operand below if stack is empty, otherwise done */ if (!env.argStack.is_empty ()) return;