Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
6482fda5
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看板
提交
6482fda5
编写于
11月 05, 2018
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[fuzzing] Fuzz glyph-id etc in test-ot-face
上级
252632c4
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
30 addition
and
46 deletion
+30
-46
test/api/test-ot-face.c
test/api/test-ot-face.c
+29
-28
test/fuzzing/hb-shape-fuzzer.cc
test/fuzzing/hb-shape-fuzzer.cc
+1
-18
未找到文件。
test/api/test-ot-face.c
浏览文件 @
6482fda5
...
@@ -33,7 +33,8 @@
...
@@ -33,7 +33,8 @@
static
void
static
void
test_face
(
hb_face_t
*
face
)
test_face
(
hb_face_t
*
face
,
hb_codepoint_t
cp
)
{
{
hb_font_t
*
font
=
hb_font_create
(
face
);
hb_font_t
*
font
=
hb_font_create
(
face
);
hb_ot_font_set_funcs
(
font
);
hb_ot_font_set_funcs
(
font
);
...
@@ -41,35 +42,35 @@ test_face (hb_face_t *face)
...
@@ -41,35 +42,35 @@ test_face (hb_face_t *face)
hb_set_t
*
set
=
hb_set_create
();
hb_set_t
*
set
=
hb_set_create
();
hb_face_collect_unicodes
(
face
,
set
);
hb_face_collect_unicodes
(
face
,
set
);
hb_face_collect_variation_selectors
(
face
,
set
);
hb_face_collect_variation_selectors
(
face
,
set
);
hb_face_collect_variation_unicodes
(
face
,
0
,
set
);
hb_face_collect_variation_unicodes
(
face
,
cp
,
set
);
hb_codepoint_t
g
;
hb_codepoint_t
g
;
hb_position_t
x
,
y
;
hb_position_t
x
,
y
;
hb_glyph_extents_t
extents
;
hb_glyph_extents_t
extents
;
char
buf
[
5
]
=
{
0
};
char
buf
[
5
]
=
{
0
};
hb_font_get_nominal_glyph
(
font
,
0
,
&
g
);
hb_font_get_nominal_glyph
(
font
,
cp
,
&
g
);
hb_font_get_variation_glyph
(
font
,
0
,
0
,
&
g
);
hb_font_get_variation_glyph
(
font
,
cp
,
cp
,
&
g
);
hb_font_get_glyph_h_advance
(
font
,
g
);
hb_font_get_glyph_h_advance
(
font
,
cp
);
hb_font_get_glyph_v_advance
(
font
,
g
);
hb_font_get_glyph_v_advance
(
font
,
cp
);
hb_font_get_glyph_h_origin
(
font
,
g
,
&
x
,
&
y
);
hb_font_get_glyph_h_origin
(
font
,
cp
,
&
x
,
&
y
);
hb_font_get_glyph_v_origin
(
font
,
g
,
&
x
,
&
y
);
hb_font_get_glyph_v_origin
(
font
,
cp
,
&
x
,
&
y
);
hb_font_get_glyph_extents
(
font
,
g
,
&
extents
);
hb_font_get_glyph_extents
(
font
,
cp
,
&
extents
);
hb_font_get_glyph_contour_point
(
font
,
g
,
0
,
&
x
,
&
y
);
hb_font_get_glyph_contour_point
(
font
,
cp
,
0
,
&
x
,
&
y
);
hb_font_get_glyph_name
(
font
,
g
,
buf
,
sizeof
(
buf
));
hb_font_get_glyph_name
(
font
,
cp
,
buf
,
sizeof
(
buf
));
hb_font_get_glyph_from_name
(
font
,
buf
,
strlen
(
buf
),
&
g
);
hb_font_get_glyph_from_name
(
font
,
buf
,
strlen
(
buf
),
&
g
);
hb_ot_color_has_palettes
(
face
);
hb_ot_color_has_palettes
(
face
);
hb_ot_color_palette_get_count
(
face
);
hb_ot_color_palette_get_count
(
face
);
hb_ot_color_palette_get_name_id
(
face
,
0
);
hb_ot_color_palette_get_name_id
(
face
,
cp
);
hb_ot_color_palette_color_get_name_id
(
face
,
0
);
hb_ot_color_palette_color_get_name_id
(
face
,
cp
);
hb_ot_color_palette_get_flags
(
face
,
0
);
hb_ot_color_palette_get_flags
(
face
,
cp
);
hb_ot_color_palette_get_colors
(
face
,
0
,
0
,
NULL
,
NULL
);
hb_ot_color_palette_get_colors
(
face
,
cp
,
0
,
NULL
,
NULL
);
hb_ot_color_has_layers
(
face
);
hb_ot_color_has_layers
(
face
);
hb_ot_color_glyph_get_layers
(
face
,
0
,
0
,
NULL
,
NULL
);
hb_ot_color_glyph_get_layers
(
face
,
cp
,
0
,
NULL
,
NULL
);
hb_ot_color_has_svg
(
face
);
hb_ot_color_has_svg
(
face
);
hb_blob_destroy
(
hb_ot_color_glyph_reference_svg
(
face
,
0
));
hb_blob_destroy
(
hb_ot_color_glyph_reference_svg
(
face
,
cp
));
hb_ot_color_has_png
(
face
);
hb_ot_color_has_png
(
face
);
hb_blob_destroy
(
hb_ot_color_glyph_reference_png
(
font
,
0
));
hb_blob_destroy
(
hb_ot_color_glyph_reference_png
(
font
,
cp
));
hb_ot_layout_has_glyph_classes
(
face
);
hb_ot_layout_has_glyph_classes
(
face
);
hb_ot_layout_has_substitution
(
face
);
hb_ot_layout_has_substitution
(
face
);
...
@@ -77,19 +78,19 @@ test_face (hb_face_t *face)
...
@@ -77,19 +78,19 @@ test_face (hb_face_t *face)
hb_ot_math_has_data
(
face
);
hb_ot_math_has_data
(
face
);
hb_ot_math_get_constant
(
font
,
HB_OT_MATH_CONSTANT_MATH_LEADING
);
hb_ot_math_get_constant
(
font
,
HB_OT_MATH_CONSTANT_MATH_LEADING
);
hb_ot_math_get_glyph_italics_correction
(
font
,
0
);
hb_ot_math_get_glyph_italics_correction
(
font
,
cp
);
hb_ot_math_get_glyph_top_accent_attachment
(
font
,
0
);
hb_ot_math_get_glyph_top_accent_attachment
(
font
,
cp
);
hb_ot_math_is_glyph_extended_shape
(
face
,
0
);
hb_ot_math_is_glyph_extended_shape
(
face
,
cp
);
hb_ot_math_get_glyph_kerning
(
font
,
0
,
HB_OT_MATH_KERN_BOTTOM_RIGHT
,
0
);
hb_ot_math_get_glyph_kerning
(
font
,
cp
,
HB_OT_MATH_KERN_BOTTOM_RIGHT
,
0
);
hb_ot_math_get_glyph_variants
(
font
,
0
,
HB_DIRECTION_TTB
,
0
,
NULL
,
NULL
);
hb_ot_math_get_glyph_variants
(
font
,
cp
,
HB_DIRECTION_TTB
,
0
,
NULL
,
NULL
);
hb_ot_math_get_min_connector_overlap
(
font
,
HB_DIRECTION_RTL
);
hb_ot_math_get_min_connector_overlap
(
font
,
HB_DIRECTION_RTL
);
hb_ot_math_get_glyph_assembly
(
font
,
0
,
HB_DIRECTION_BTT
,
0
,
NULL
,
NULL
,
NULL
);
hb_ot_math_get_glyph_assembly
(
font
,
cp
,
HB_DIRECTION_BTT
,
0
,
NULL
,
NULL
,
NULL
);
unsigned
int
len
=
sizeof
(
buf
);
unsigned
int
len
=
sizeof
(
buf
);
hb_ot_name_list_names
(
face
,
NULL
);
hb_ot_name_list_names
(
face
,
NULL
);
hb_ot_name_get_utf8
(
face
,
0
,
NULL
,
&
len
,
buf
);
hb_ot_name_get_utf8
(
face
,
cp
,
NULL
,
&
len
,
buf
);
hb_ot_name_get_utf16
(
face
,
0
,
NULL
,
NULL
,
NULL
);
hb_ot_name_get_utf16
(
face
,
cp
,
NULL
,
NULL
,
NULL
);
hb_ot_name_get_utf32
(
face
,
0
,
NULL
,
NULL
,
NULL
);
hb_ot_name_get_utf32
(
face
,
cp
,
NULL
,
NULL
,
NULL
);
hb_ot_var_get_axis_count
(
face
);
hb_ot_var_get_axis_count
(
face
);
hb_ot_var_get_axes
(
face
,
0
,
NULL
,
NULL
);
hb_ot_var_get_axes
(
face
,
0
,
NULL
,
NULL
);
...
@@ -104,7 +105,7 @@ test_face (hb_face_t *face)
...
@@ -104,7 +105,7 @@ test_face (hb_face_t *face)
static
void
static
void
test_ot_face_empty
(
void
)
test_ot_face_empty
(
void
)
{
{
test_face
(
hb_face_get_empty
());
test_face
(
hb_face_get_empty
()
,
0
);
}
}
int
int
...
...
test/fuzzing/hb-shape-fuzzer.cc
浏览文件 @
6482fda5
...
@@ -32,28 +32,11 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
...
@@ -32,28 +32,11 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
hb_buffer_add_utf32
(
buffer
,
text32
,
sizeof
(
text32
)
/
sizeof
(
text32
[
0
]),
0
,
-
1
);
hb_buffer_add_utf32
(
buffer
,
text32
,
sizeof
(
text32
)
/
sizeof
(
text32
[
0
]),
0
,
-
1
);
hb_buffer_guess_segment_properties
(
buffer
);
hb_buffer_guess_segment_properties
(
buffer
);
hb_shape
(
font
,
buffer
,
NULL
,
0
);
hb_shape
(
font
,
buffer
,
NULL
,
0
);
unsigned
int
len
=
hb_buffer_get_length
(
buffer
);
hb_glyph_info_t
*
infos
=
hb_buffer_get_glyph_infos
(
buffer
,
NULL
);
//hb_glyph_position_t *positions = hb_buffer_get_glyph_positions (buffer, NULL);
for
(
unsigned
int
i
=
0
;
i
<
len
;
i
++
)
{
hb_glyph_info_t
info
=
infos
[
i
];
//hb_glyph_position_t pos = positions[i];
hb_glyph_extents_t
extents
;
hb_font_get_glyph_extents
(
font
,
info
.
codepoint
,
&
extents
);
hb_ot_color_glyph_get_layers
(
face
,
info
.
codepoint
,
0
,
nullptr
,
nullptr
);
hb_blob_destroy
(
hb_ot_color_glyph_reference_svg
(
face
,
info
.
codepoint
));
hb_blob_destroy
(
hb_ot_color_glyph_reference_png
(
font
,
info
.
codepoint
));
}
hb_buffer_destroy
(
buffer
);
hb_buffer_destroy
(
buffer
);
}
}
/* Misc calls on face. */
/* Misc calls on face. */
test_face
(
face
);
test_face
(
face
,
text32
[
15
]
);
hb_font_destroy
(
font
);
hb_font_destroy
(
font
);
hb_face_destroy
(
face
);
hb_face_destroy
(
face
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录