summaryrefslogtreecommitdiffstats
path: root/external/freetype/ubsan.patch
blob: c8173eeff531c2e91a98ede6f79d405c44c19312 (plain)
1
2
3
4
5
6
7
8
9
10
11
--- src/truetype/ttgxvar.c
+++ src/truetype/ttgxvar.c
@@ -964,7 +964,7 @@
     /* in the OpenType specification.                  */
 
     varData  = &itemStore->varData[outerIndex];
-    deltaSet = &varData->deltaSet[varData->regionIdxCount * innerIndex];
+    deltaSet = varData->regionIdxCount * innerIndex == 0 ? varData->deltaSet : &varData->deltaSet[varData->regionIdxCount * innerIndex];
 
     /* outer loop steps through master designs to be blended */
     for ( master = 0; master < varData->regionIdxCount; master++ )