summaryrefslogtreecommitdiff
path: root/thirdparty/harfbuzz/src/hb-cff-interp-cs-common.hh
diff options
context:
space:
mode:
Diffstat (limited to 'thirdparty/harfbuzz/src/hb-cff-interp-cs-common.hh')
-rw-r--r--thirdparty/harfbuzz/src/hb-cff-interp-cs-common.hh7
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;