Commit e6fda039ad638866b7a6a5d046f03278ba1b7611

Werner Lemberg 2022-11-14T19:18:19

* src/truetype/ttgxvar.c (tt_hvadvance_adjust): Integer overflow. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=50462

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/src/truetype/ttgxvar.c b/src/truetype/ttgxvar.c
index 370a92c..d2452f8 100644
--- a/src/truetype/ttgxvar.c
+++ b/src/truetype/ttgxvar.c
@@ -42,6 +42,7 @@
 #include <ft2build.h>
 #include <freetype/internal/ftdebug.h>
 #include FT_CONFIG_CONFIG_H
+#include <freetype/internal/ftcalc.h>
 #include <freetype/internal/ftstream.h>
 #include <freetype/internal/sfnt.h>
 #include <freetype/tttags.h>
@@ -1207,7 +1208,7 @@
                   delta == 1 ? "" : "s",
                   vertical ? "VVAR" : "HVAR" ));
 
-      *avalue += delta;
+      *avalue = ADD_INT( *avalue, delta );
     }
 
   Exit: