Commit 5e02965905e64e543a92d8d29fba32c86b350104

Werner Lemberg 2018-12-25T19:24:06

* src/psaux/cffdecode.c (cff_operaor_seac): Fix numeric overflow. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11915

diff --git a/ChangeLog b/ChangeLog
index a6c02b9..c9629a8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2018-12-25  Werner Lemberg  <wl@gnu.org>
+
+	* src/psaux/cffdecode.c (cff_operaor_seac): Fix numeric overflow.
+
+	Reported as
+
+	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11915
+
 2018-12-12  Werner Lemberg  <wl@gnu.org>
 
 	[gxvalid] Fix compiler warnings.
diff --git a/src/psaux/cffdecode.c b/src/psaux/cffdecode.c
index 09a77cd..def2b22 100644
--- a/src/psaux/cffdecode.c
+++ b/src/psaux/cffdecode.c
@@ -235,8 +235,8 @@
       return FT_THROW( Syntax_Error );
     }
 
-    adx += decoder->builder.left_bearing.x;
-    ady += decoder->builder.left_bearing.y;
+    adx = ADD_LONG( adx, decoder->builder.left_bearing.x );
+    ady = ADD_LONG( ady, decoder->builder.left_bearing.y );
 
 #ifdef FT_CONFIG_OPTION_INCREMENTAL
     /* Incremental fonts don't necessarily have valid charsets.        */