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

Huw Davies huw at codeweavers.com
Thu Dec 14 04:42:28 CST 2017


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.

Huw.



More information about the wine-devel mailing list