[PATCH] gdi32: Clamp unsigned integers to 32-bit range when scaling fonts

Alex Henrie alexhenrie24 at gmail.com
Mon Dec 18 21:31:38 CST 2017


2017-12-18 1:31 GMT-07:00 Huw Davies <Huw.Davies at physics.ox.ac.uk>:
>
>> On 18 Dec 2017, at 01:03, Alex Henrie <alexhenrie24 at gmail.com> wrote:
>>
>> 2017-12-14 3:42 GMT-07:00 Huw Davies <huw at codeweavers.com>:
>>> On Mon, Dec 11, 2017 at 10:10:48PM -0700, Alex Henrie wrote:
>>>> Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
>>>> ---
>>>> Fixes test crash (floating point exception due to double value outside
>>>> of integer range) with TAMu_Kadampari.ttf from Arch Linux's
>>>> ttf-indic-otf package. sTypoLineGap is -194 in this font, and Windows 10
>>>> sets otmLineGap to 4294967295.
>>>>
>>>> Also fixes the crash with GohaTibebZemen.otf from Arch's xorg-fonts-misc
>>>> package. sCapHeight and sxHeight are -32768 in this font, and Windows 10
>>>> refuses to install it. However, Windows XP installs the font without
>>>> complaint and sets otmsCapEmHeight and otmsXHeight to 4294966903. I
>>>> think the 0.00000009% difference from UINT_MAX is just rounding error.
>>>
>>> It looks to me as if these are being scaled as signed ints.
>>
>> Would it be acceptable to add clamping to GDI_ROUND then?
>
> Did you try scaling as a signed int?

Ah, I see what you mean now. Yes, you're right, they're being scaled
as signed ints and then cast back to unsigned ints.

-Alex



More information about the wine-devel mailing list