summaryrefslogtreecommitdiffstats
path: root/external/freetype/ubsan.patch
blob: 43ce217c4b7df38084956e0111f678a99ec903f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
--- src/psaux/psobjs.c.orig	2023-02-04 23:00:05.000000000 +0900
+++ src/psaux/psobjs.c	2023-02-22 16:28:26.632283841 +0900
@@ -200,7 +200,8 @@
     /* add the object to the base block and adjust offset */
     table->elements[idx] = FT_OFFSET( table->block, table->cursor );
     table->lengths [idx] = length;
-    FT_MEM_COPY( table->block + table->cursor, object, length );
+    if (length != 0)
+      FT_MEM_COPY( table->block + table->cursor, object, length );
 
     table->cursor += length;
     return FT_Err_Ok;
--- src/truetype/ttgxvar.c
+++ src/truetype/ttgxvar.c
@@ -1045,7 +1045,7 @@
     if ( varData->longWords )
       per_region_size *= 2;
 
-    bytes = varData->deltaSet + per_region_size * innerIndex;
+    bytes = varData->deltaSet ? varData->deltaSet + per_region_size * innerIndex : NULL;
 
     if ( varData->longWords )
     {