freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft-devel] Curb the scaling


From: Werner LEMBERG
Subject: Re: [ft-devel] Curb the scaling
Date: Thu, 12 Oct 2017 23:39:00 +0200 (CEST)

>>> As per our discussion I propose the following patch to limit the
>>> outline scaling so that ppem values do not exceed 65535.  As far
>>> as I can see, no such limits are currently in place, ppem values
>>> are simply truncated while the scaling factors are not limited.
>>
>> Looks good.
>
> I am hesitating with the ppem-limiting patch.  It turns out that the
> fuzzer requests just 20 ppem, yet it overflows.  So the glyphs
> spread far beyond the EM and FT_Face->bbox too.

As mentioned earlier, there is no chance to ever catch cumulative
values without actively comparing against a maximum value.  And such a
comparison is more expensive that using ADD_LONG and friends.

> Checking for reasonable size by calling FT_Outline_Get_CBox may seem
> excessive, but we do call it twice anyway when we enter
> FT_Render_Glyph.  We do not need much, a lot of overflows will be
> avoided if we only limit actual CBox to, say, 4 times EM.

Honestly spoken, this looks very artificial and arbitrary.


    Werner



reply via email to

[Prev in Thread] Current Thread [Next in Thread]