freetype-devel
[Top][All Lists]
Advanced

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

Re: [ft-devel] Undefined behavior


From: Alexei Podtelezhnikov
Subject: Re: [ft-devel] Undefined behavior
Date: Sat, 9 Aug 2014 13:50:49 -0400

On Fri, Aug 8, 2014 at 4:56 PM, Behdad Esfahbod <address@hidden> wrote:
>
>     * src/base/ftcalc.c (FT_MSB): Utilize gcc builtins.
>
> introduced undefined behavior, since __builtin_clz and __builtin_ctz have
> undefined behavior if passed in value is zero.
>
> This can actually happen with degenerate glyph outlines.  It might be
> harmless, but it's something that should be fixed.

There is just a handful of places where FT_MSB is used.
* ftoutln.c, FT_MSB is used for scaling and you cannot really
scale/shift 0 unsafely or undefinedly.
* fttrigon.c, the same reasoning applies
* ftbbox.c, the same reasoning applies
* src/pfr/pfrobjs.c, do you think count can be 0 here?



reply via email to

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