[smooth] Fix integer overflow (#47114).

* src/smooth/ftgrays.c (TArea): Make it unconditionally `long'.
This commit is contained in:
Alexei Podtelezhnikov 2016-02-16 22:32:13 -05:00
parent 3a5e507838
commit 08e89b734c
2 changed files with 7 additions and 19 deletions

View File

@ -1,3 +1,9 @@
2016-02-16 Alexei Podtelezhnikov <apodtele@gmail.com>
[smooth] Fix integer overflow (#47114).
* src/smooth/ftgrays.c (TArea): Make it unconditionally `long'.
2016-02-15 Werner Lemberg <wl@gnu.org>
* src/cff/cffparse.c (cff_parse_multiple_master): Improve tracing.

View File

@ -388,25 +388,7 @@ typedef ptrdiff_t FT_PtrDist;
typedef long TCoord; /* integer scanline/pixel coordinate */
typedef long TPos; /* sub-pixel coordinate */
/* determine the type used to store cell areas. This normally takes at */
/* least PIXEL_BITS*2 + 1 bits. On 16-bit systems, we need to use */
/* `long' instead of `int', otherwise bad things happen */
#if PIXEL_BITS <= 7
typedef int TArea;
#else /* PIXEL_BITS >= 8 */
/* approximately determine the size of integers using an ANSI-C header */
#if FT_UINT_MAX == 0xFFFFU
typedef long TArea;
#else
typedef int TArea;
#endif
#endif /* PIXEL_BITS >= 8 */
typedef long TArea; /* cell areas, coordinate products */
/* maximum number of gray spans in a call to the span callback */