diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2022-07-24 23:05:03 +0300 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2022-07-24 23:05:03 +0300 |
commit | 5f5a9f256cad866172c18939e31162ba038ac02e (patch) | |
tree | c0d398d0ae345b40fd7b847057267f4ad1852554 /thirdparty/harfbuzz/src/hb-cff-interp-cs-common.hh | |
parent | b3df27526a0374f2fd5f44eab99da4b4bfd9f9ec (diff) | |
download | redot-engine-5f5a9f256cad866172c18939e31162ba038ac02e.tar.gz |
HarfBuzz: Update to version 5.0.1
Diffstat (limited to 'thirdparty/harfbuzz/src/hb-cff-interp-cs-common.hh')
-rw-r--r-- | thirdparty/harfbuzz/src/hb-cff-interp-cs-common.hh | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/thirdparty/harfbuzz/src/hb-cff-interp-cs-common.hh b/thirdparty/harfbuzz/src/hb-cff-interp-cs-common.hh index 2983ae54a1..f93c83ab45 100644 --- a/thirdparty/harfbuzz/src/hb-cff-interp-cs-common.hh +++ b/thirdparty/harfbuzz/src/hb-cff-interp-cs-common.hh @@ -57,6 +57,7 @@ struct call_context_t /* call stack */ const unsigned int kMaxCallLimit = 10; +const unsigned int kMaxOps = 10000; struct call_stack_t : cff_stack_t<call_context_t, kMaxCallLimit> {}; template <typename SUBRS> @@ -881,7 +882,13 @@ struct cs_interpreter_t : interpreter_t<ENV> { SUPER::env.set_endchar (false); + unsigned max_ops = kMaxOps; for (;;) { + if (unlikely (!--max_ops)) + { + SUPER::env.set_error (); + break; + } OPSET::process_op (SUPER::env.fetch_op (), SUPER::env, param); if (unlikely (SUPER::env.in_error ())) return false; |