!112 merge master into master

[truetype] Prevent signed integer overflow

Created-by: ZacohZhen
Commit-by: ZacohZhen
Merged-by: openharmony_ci
Description: ### 相关的Issue
https://gitcode.com/openharmony/third_party_freetype/issues/184
  
### 原因(目的、解决的问题等)
有符号整数相减或相加溢出

### 描述(做了什么,变更了什么)
Use `ADD_LONG` and `SUB_LONG`

### 测试用例(新增、改动、可能影响的功能)
    
    


See merge request: openharmony/third_party_freetype!112
This commit is contained in:
openharmony_ci
2026-03-07 16:28:27 +08:00
2 changed files with 24 additions and 1 deletions
@@ -0,0 +1,21 @@
diff --git a/src/truetype/ttinterp.c b/src/truetype/ttinterp.c
index 951891d..86894c2 100644
--- a/src/truetype/ttinterp.c
+++ b/src/truetype/ttinterp.c
@@ -5664,11 +5664,11 @@
/* single width cut-in test */
/* |org_dist - single_width_value| < single_width_cutin */
- if ( exc->GS.single_width_cutin > 0 &&
- org_dist < exc->GS.single_width_value +
- exc->GS.single_width_cutin &&
- org_dist > exc->GS.single_width_value -
- exc->GS.single_width_cutin )
+ if ( exc->GS.single_width_cutin > 0 &&
+ org_dist < ADD_LONG( exc->GS.single_width_value,
+ exc->GS.single_width_cutin ) &&
+ org_dist > SUB_LONG( exc->GS.single_width_value,
+ exc->GS.single_width_cutin ) )
{
if ( org_dist >= 0 )
org_dist = exc->GS.single_width_value;
+3 -1
View File
@@ -40,6 +40,7 @@ def move_file(src_path, dst_path):
"backport-freetype-2.10.1-debughook.patch",
"backport-freetype-2.12.1-enable-funcs.patch",
"CVE-2026-23865.patch",
"backport-truetype-signed-integer-overflow.patch",
"ftconfig.h"
]
for file in files:
@@ -76,7 +77,8 @@ def do_patch(target_dir):
"backport-freetype-2.10.0-internal-outline.patch",
"backport-freetype-2.10.1-debughook.patch",
"backport-freetype-2.12.1-enable-funcs.patch",
"CVE-2026-23865.patch"
"CVE-2026-23865.patch",
"backport-truetype-signed-integer-overflow.patch"
]
for patch in patch_file: