[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ft-devel] endless loops in bytecode
From: |
Werner LEMBERG |
Subject: |
Re: [ft-devel] endless loops in bytecode |
Date: |
Mon, 12 Sep 2016 22:49:17 +0200 (CEST) |
>> My only idea up to date is to count JMPR, JROT, and JROF separately,
>> using a threshold of, say, 10000.
>
> I would run a total jump count of any kind though and stop after
> 1000 jumps of any kind.
Exactly. However, I will probably also consider the LOOPCALL counter.
> Enough is enough. The bytecode length is limited to 65536 (no?).
This is irrelevant to the problem – due to repeated calls of bytecode
functions I can imagine that for complicated glyphs a 2^16 limit gets
easily overflowed.
> In the worst case scenario, 1000 jumps will produce 65 million
> instructions.
We already have a counter that limits the number of executed
instructions per glyph to 1000000.
Another idea was to switch off hinting completely for a font in case
we ever hit the bytecode overflow limit. This I probably won't do,
though.
Werner