Define FT_LONG_MAX. * include/freetype/config/ftstdlib.h (FT_LONG_MAX): New macro. * src/cff/cf2arrst.c (cf2_arrstack_setNumElements): Use it.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
diff --git a/ChangeLog b/ChangeLog
index 065a16b..a5e353b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,15 @@
-2015-07-28 Alexei Podtelezhnikov <apodtele@gmail.com>
+2015-07-31 Werner Lemberg <wl@gnu.org>
+
+ Define FT_LONG_MAX.
+
+ * include/freetype/config/ftstdlib.h (FT_LONG_MAX): New macro.
+ * src/cff/cf2arrst.c (cf2_arrstack_setNumElements): Use it.
+
+2015-07-28 Alexei Podtelezhnikov <apodtele@gmail.com>
* src/base/ftcalc.c (FT_Vector_NormLen): Clarify.
-2015-07-27 Alexei Podtelezhnikov <apodtele@gmail.com>
+2015-07-27 Alexei Podtelezhnikov <apodtele@gmail.com>
* src/base/ftcalc.c (FT_Vector_NormLen): Explicate type conversions.
diff --git a/include/freetype/config/ftstdlib.h b/include/freetype/config/ftstdlib.h
index 8ef43c0..4b471d4 100644
--- a/include/freetype/config/ftstdlib.h
+++ b/include/freetype/config/ftstdlib.h
@@ -64,6 +64,7 @@
#define FT_INT_MAX INT_MAX
#define FT_INT_MIN INT_MIN
#define FT_UINT_MAX UINT_MAX
+#define FT_LONG_MAX LONG_MAX
#define FT_ULONG_MAX ULONG_MAX
diff --git a/src/cff/cf2arrst.c b/src/cff/cf2arrst.c
index 528b1fa..89f3e9f 100644
--- a/src/cff/cf2arrst.c
+++ b/src/cff/cf2arrst.c
@@ -104,7 +104,7 @@
size_t newSize = numElements * arrstack->sizeItem;
- if ( numElements > LONG_MAX / arrstack->sizeItem )
+ if ( numElements > FT_LONG_MAX / arrstack->sizeItem )
goto exit;