[cff] Fix fetch_op() bounds-checking

This commit is contained in:
Behdad Esfahbod 2022-11-21 10:51:33 -07:00
parent b51ab1a9e5
commit 6905d36d73
1 changed files with 2 additions and 2 deletions

View File

@ -564,13 +564,13 @@ struct interp_env_t
if (unlikely (!str_ref.avail ()))
return OpCode_Invalid;
op = (op_code_t)(unsigned char)str_ref[0];
str_ref.inc ();
if (op == OpCode_escape) {
if (unlikely (!str_ref.avail ()))
return OpCode_Invalid;
op = Make_OpCode_ESC(str_ref[1]);
op = Make_OpCode_ESC(str_ref[0]);
str_ref.inc ();
}
str_ref.inc ();
return op;
}