ref: 7a4276fb9095430b86b329f52fb8dfe26f966dcd
parent: 03b0cc2ea9b63f57ec58f77d8cc1350691d7140a
author: Werner Lemberg <[email protected]>
date: Fri Jun 2 05:21:37 EDT 2017
[cff] More integer overflows. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2032 * src/cff/cf2blues.c (cf2_blues_init): Use OVERFLOW_SUB_INT32.
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
2017-06-02 Werner Lemberg <[email protected]>
+ [cff] More integer overflows.
+
+ Reported as
+
+ https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2032
+
+ * src/cff/cf2blues.c (cf2_blues_init): Use OVERFLOW_SUB_INT32.
+
+2017-06-02 Werner Lemberg <[email protected]>
+
[bdf] Don't left-shift negative numbers.
Reported as
--- a/src/cff/cf2blues.c
+++ b/src/cff/cf2blues.c
@@ -301,7 +301,8 @@
/* top edge */
flatFamilyEdge = cf2_blueToFixed( familyOtherBlues[j + 1] );
- diff = cf2_fixedAbs( flatEdge - flatFamilyEdge );
+ diff = cf2_fixedAbs( OVERFLOW_SUB_INT32( flatEdge,
+ flatFamilyEdge ) );
if ( diff < minDiff && diff < csUnitsPerPixel )
{
@@ -319,7 +320,8 @@
/* top edge */
flatFamilyEdge = cf2_blueToFixed( familyBlues[1] );
- diff = cf2_fixedAbs( flatEdge - flatFamilyEdge );
+ diff = cf2_fixedAbs( OVERFLOW_SUB_INT32( flatEdge,
+ flatFamilyEdge ) );
if ( diff < minDiff && diff < csUnitsPerPixel )
blues->zone[i].csFlatEdge = flatFamilyEdge;
@@ -342,7 +344,8 @@
/* adjust edges of top zone upward by twice darkening amount */
flatFamilyEdge += 2 * font->darkenY; /* bottom edge */
- diff = cf2_fixedAbs( flatEdge - flatFamilyEdge );
+ diff = cf2_fixedAbs( OVERFLOW_SUB_INT32( flatEdge,
+ flatFamilyEdge ) );
if ( diff < minDiff && diff < csUnitsPerPixel )
{