Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
1a94804d
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
接近 2 年 前同步成功
通知
1
Star
18
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Harfbuzz
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
“6656920b0b50beacb6cb64cf55273cbb686e436e”上不存在“arch/xtensa/include/asm/io.h”
提交
1a94804d
编写于
3月 19, 2018
作者:
G
Garret Rieger
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[subset] Add a fix for segfault in hmtx/vmtx subsetting code.
上级
31281d6a
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
13 addition
and
3 deletion
+13
-3
src/hb-ot-hmtx-table.hh
src/hb-ot-hmtx-table.hh
+11
-2
test/api/test-subset-hmtx.c
test/api/test-subset-hmtx.c
+2
-1
未找到文件。
src/hb-ot-hmtx-table.hh
浏览文件 @
1a94804d
...
@@ -118,6 +118,8 @@ struct hmtxvmtx
...
@@ -118,6 +118,8 @@ struct hmtxvmtx
LongMetric
*
old_metrics
=
(
LongMetric
*
)
source_table
;
LongMetric
*
old_metrics
=
(
LongMetric
*
)
source_table
;
FWORD
*
lsbs
=
(
FWORD
*
)
(
old_metrics
+
_mtx
.
num_advances
);
FWORD
*
lsbs
=
(
FWORD
*
)
(
old_metrics
+
_mtx
.
num_advances
);
char
*
dest_pos
=
(
char
*
)
dest
;
char
*
dest_pos
=
(
char
*
)
dest
;
bool
failed
=
false
;
for
(
unsigned
int
i
=
0
;
i
<
gids
.
len
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
gids
.
len
;
i
++
)
{
{
/* the last metric or the one for gids[i] */
/* the last metric or the one for gids[i] */
...
@@ -138,7 +140,14 @@ struct hmtxvmtx
...
@@ -138,7 +140,14 @@ struct hmtxvmtx
}
}
else
else
{
{
FWORD
src_lsb
=
*
(
lsbs
+
gids
[
i
]
-
_mtx
.
num_advances
);
if
(
gids
[
i
]
>=
_mtx
.
num_metrics
)
{
DEBUG_MSG
(
SUBSET
,
nullptr
,
"gid %d is >= number of source metrics %d"
,
gids
[
i
],
_mtx
.
num_metrics
);
failed
=
true
;
break
;
}
FWORD
src_lsb
=
*
(
lsbs
+
gids
[
i
]
-
_mtx
.
num_advances
);
if
(
i
<
num_advances
)
if
(
i
<
num_advances
)
{
{
/* dest needs a full LongMetric */
/* dest needs a full LongMetric */
...
@@ -157,7 +166,7 @@ struct hmtxvmtx
...
@@ -157,7 +166,7 @@ struct hmtxvmtx
_mtx
.
fini
();
_mtx
.
fini
();
// Amend header num hmetrics
// Amend header num hmetrics
if
(
unlikely
(
!
subset_update_header
(
plan
,
num_advances
)))
if
(
failed
||
unlikely
(
!
subset_update_header
(
plan
,
num_advances
)))
{
{
free
(
dest
);
free
(
dest
);
return
false
;
return
false
;
...
...
test/api/test-subset-hmtx.c
浏览文件 @
1a94804d
...
@@ -163,7 +163,8 @@ test_subset_invalid_hmtx (void)
...
@@ -163,7 +163,8 @@ test_subset_invalid_hmtx (void)
hb_subset_profile_t
*
profile
=
hb_subset_profile_create
();
hb_subset_profile_t
*
profile
=
hb_subset_profile_create
();
hb_face_t
*
subset
=
hb_subset
(
face
,
profile
,
input
);
hb_face_t
*
subset
=
hb_subset
(
face
,
profile
,
input
);
g_assert
(
!
subset
);
g_assert
(
subset
);
g_assert
(
subset
==
hb_face_get_empty
());
hb_subset_input_destroy
(
input
);
hb_subset_input_destroy
(
input
);
hb_subset_profile_destroy
(
profile
);
hb_subset_profile_destroy
(
profile
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录