[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?
Re: [ft-devel] Undefined behavior, Alexei Podtelezhnikov, 2014/08/11