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

Alex Henrie alexhenrie24 at gmail.com
Sun Dec 17 19:03:03 CST 2017


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?

-Alex



More information about the wine-devel mailing list