Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
6a38fd68
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看板
提交
6a38fd68
编写于
10月 27, 2018
作者:
E
Ebrahim Byagowi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[ot-color/png] sbix runtime memory check
上级
265ad408
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
21 addition
and
17 deletion
+21
-17
src/hb-ot-color-cbdt-table.hh
src/hb-ot-color-cbdt-table.hh
+7
-9
src/hb-ot-color-sbix-table.hh
src/hb-ot-color-sbix-table.hh
+12
-6
src/hb-ot-color-svg-table.hh
src/hb-ot-color-svg-table.hh
+2
-2
未找到文件。
src/hb-ot-color-cbdt-table.hh
浏览文件 @
6a38fd68
...
@@ -452,7 +452,7 @@ struct CBDT
...
@@ -452,7 +452,7 @@ struct CBDT
}
}
inline
void
dump
(
void
(
*
callback
)
(
const
uint8_t
*
data
,
unsigned
int
length
,
inline
void
dump
(
void
(
*
callback
)
(
const
uint8_t
*
data
,
unsigned
int
length
,
unsigned
int
group
,
unsigned
int
gid
))
const
unsigned
int
group
,
unsigned
int
gid
))
const
{
{
if
(
!
cblc
)
if
(
!
cblc
)
return
;
// Not a color bitmap font.
return
;
// Not a color bitmap font.
...
@@ -504,15 +504,13 @@ struct CBDT
...
@@ -504,15 +504,13 @@ struct CBDT
}
}
}
}
inline
hb_blob_t
*
reference_blob_for_glyph
(
hb_codepoint_t
glyph_id
,
inline
hb_blob_t
*
reference_blob_for_glyph
(
hb_codepoint_t
glyph_id
HB_UNUSED
,
unsigned
int
requested_x_ppem
,
unsigned
int
requested_x_ppem
HB_UNUSED
,
unsigned
int
requested_y_ppem
,
unsigned
int
requested_y_ppem
HB_UNUSED
,
unsigned
int
*
strike_x_ppem
,
unsigned
int
*
strike_x_ppem
HB_UNUSED
,
unsigned
int
*
strike_y_ppem
)
const
unsigned
int
*
strike_y_ppem
HB_UNUSED
)
const
{
{
// if (unlikely (cbdt_len == 0))
return
hb_blob_get_empty
();
return
hb_blob_get_empty
();
// return svg->get_glyph_entry (glyph_id).reference_blob (svg_blob, svg->svgDocEntries);
}
}
inline
bool
has_data
()
const
inline
bool
has_data
()
const
...
...
src/hb-ot-color-sbix-table.hh
浏览文件 @
6a38fd68
...
@@ -82,6 +82,7 @@ struct SBIXStrike
...
@@ -82,6 +82,7 @@ struct SBIXStrike
inline
hb_blob_t
*
get_glyph_blob
(
unsigned
int
glyph_id
,
inline
hb_blob_t
*
get_glyph_blob
(
unsigned
int
glyph_id
,
hb_blob_t
*
sbix_blob
,
hb_blob_t
*
sbix_blob
,
unsigned
int
sbix_len
,
unsigned
int
strike_offset
,
unsigned
int
strike_offset
,
unsigned
int
*
x_offset
,
unsigned
int
*
x_offset
,
unsigned
int
*
y_offset
,
unsigned
int
*
y_offset
,
...
@@ -91,6 +92,9 @@ struct SBIXStrike
...
@@ -91,6 +92,9 @@ struct SBIXStrike
if
(
imageOffsetsZ
[
glyph_id
+
1
]
-
imageOffsetsZ
[
glyph_id
]
==
0
)
if
(
imageOffsetsZ
[
glyph_id
+
1
]
-
imageOffsetsZ
[
glyph_id
]
==
0
)
return
hb_blob_get_empty
();
return
hb_blob_get_empty
();
if
(
strike_offset
+
(
unsigned
int
)
imageOffsetsZ
[
glyph_id
]
+
SBIXGlyph
::
min_size
>
sbix_len
)
return
hb_blob_get_empty
();
const
SBIXGlyph
*
glyph
=
&
(
this
+
imageOffsetsZ
[
glyph_id
]);
const
SBIXGlyph
*
glyph
=
&
(
this
+
imageOffsetsZ
[
glyph_id
]);
if
(
unlikely
(
glyph
->
graphicType
==
HB_TAG
(
'd'
,
'u'
,
'p'
,
'e'
)
&&
if
(
unlikely
(
glyph
->
graphicType
==
HB_TAG
(
'd'
,
'u'
,
'p'
,
'e'
)
&&
blob_size
(
glyph_id
)
>=
2
))
blob_size
(
glyph_id
)
>=
2
))
...
@@ -100,6 +104,8 @@ struct SBIXStrike
...
@@ -100,6 +104,8 @@ struct SBIXStrike
{
{
glyph
=
&
(
this
+
imageOffsetsZ
[
new_glyph_id
]);
glyph
=
&
(
this
+
imageOffsetsZ
[
new_glyph_id
]);
glyph_id
=
new_glyph_id
;
glyph_id
=
new_glyph_id
;
if
(
strike_offset
+
(
unsigned
int
)
imageOffsetsZ
[
glyph_id
]
+
SBIXGlyph
::
min_size
>
sbix_len
)
return
hb_blob_get_empty
();
}
}
}
}
if
(
unlikely
(
requested_file_type
!=
glyph
->
graphicType
))
if
(
unlikely
(
requested_file_type
!=
glyph
->
graphicType
))
...
@@ -155,18 +161,18 @@ struct sbix
...
@@ -155,18 +161,18 @@ struct sbix
const
SBIXStrike
&
strike
=
sbix_table
+
sbix_table
->
strikes
[
group
];
const
SBIXStrike
&
strike
=
sbix_table
+
sbix_table
->
strikes
[
group
];
for
(
unsigned
int
glyph_id
=
0
;
glyph_id
<
num_glyphs
;
glyph_id
++
)
for
(
unsigned
int
glyph_id
=
0
;
glyph_id
<
num_glyphs
;
glyph_id
++
)
{
{
unsigned
int
x_offset
,
y_offset
;
hb_tag_t
tag
;
hb_tag_t
tag
;
hb_blob_t
*
blob
;
hb_blob_t
*
blob
;
blob
=
strike
.
get_glyph_blob
(
glyph_id
,
sbix_blob
,
sbix_table
->
strikes
[
group
],
blob
=
strike
.
get_glyph_blob
(
glyph_id
,
sbix_blob
,
sbix_len
,
&
x_offset
,
&
x_offset
,
sbix_table
->
strikes
[
group
],
nullptr
,
nullptr
,
HB_TAG
(
'p'
,
'n'
,
'g'
,
' '
),
num_glyphs
);
HB_TAG
(
'p'
,
'n'
,
'g'
,
' '
),
num_glyphs
);
if
(
hb_blob_get_length
(
blob
))
callback
(
blob
,
group
,
glyph_id
);
if
(
hb_blob_get_length
(
blob
))
callback
(
blob
,
group
,
glyph_id
);
}
}
}
}
}
}
inline
hb_blob_t
*
reference_blob_for_glyph
(
hb_codepoint_t
glyph_id
,
inline
hb_blob_t
*
reference_blob_for_glyph
(
hb_codepoint_t
glyph_id
,
unsigned
int
ptem
HB_UNUSED
,
unsigned
int
ptem
HB_UNUSED
,
unsigned
int
requested_ppem
,
unsigned
int
requested_ppem
,
unsigned
int
requested_file_type
,
unsigned
int
requested_file_type
,
...
@@ -187,7 +193,8 @@ struct sbix
...
@@ -187,7 +193,8 @@ struct sbix
const
SBIXStrike
&
strike
=
sbix_table
+
sbix_table
->
strikes
[
group
];
const
SBIXStrike
&
strike
=
sbix_table
+
sbix_table
->
strikes
[
group
];
if
(
available_x_ppem
)
*
available_x_ppem
=
strike
.
get_ppem
();
if
(
available_x_ppem
)
*
available_x_ppem
=
strike
.
get_ppem
();
if
(
available_y_ppem
)
*
available_y_ppem
=
strike
.
get_ppem
();
if
(
available_y_ppem
)
*
available_y_ppem
=
strike
.
get_ppem
();
return
strike
.
get_glyph_blob
(
glyph_id
,
sbix_blob
,
sbix_table
->
strikes
[
group
],
return
strike
.
get_glyph_blob
(
glyph_id
,
sbix_blob
,
sbix_len
,
sbix_table
->
strikes
[
group
],
nullptr
,
nullptr
,
requested_file_type
,
num_glyphs
);
nullptr
,
nullptr
,
requested_file_type
,
num_glyphs
);
}
}
...
@@ -200,7 +207,6 @@ struct sbix
...
@@ -200,7 +207,6 @@ struct sbix
unsigned
int
sbix_len
;
unsigned
int
sbix_len
;
unsigned
int
num_glyphs
;
unsigned
int
num_glyphs
;
hb_vector_t
<
hb_vector_t
<
unsigned
int
>
>
data_offsets
;
};
};
protected:
protected:
...
...
src/hb-ot-color-svg-table.hh
浏览文件 @
6a38fd68
...
@@ -50,7 +50,7 @@ struct SVGDocumentIndexEntry
...
@@ -50,7 +50,7 @@ struct SVGDocumentIndexEntry
return
b
->
cmp
(
*
a
);
return
b
->
cmp
(
*
a
);
}
}
inline
hb_blob_t
*
reference_blob
(
hb_blob_t
*
svg_blob
,
unsigned
int
index_offset
)
const
inline
hb_blob_t
*
reference_blob
(
hb_blob_t
*
svg_blob
,
unsigned
int
index_offset
)
const
{
{
if
(
svgDocLength
==
0
)
return
hb_blob_get_empty
();
if
(
svgDocLength
==
0
)
return
hb_blob_get_empty
();
return
hb_blob_create_sub_blob
(
svg_blob
,
(
unsigned
int
)
svgDoc
+
index_offset
,
return
hb_blob_create_sub_blob
(
svg_blob
,
(
unsigned
int
)
svgDoc
+
index_offset
,
...
@@ -95,7 +95,7 @@ struct SVG
...
@@ -95,7 +95,7 @@ struct SVG
hb_blob_destroy
(
svg_blob
);
hb_blob_destroy
(
svg_blob
);
}
}
inline
hb_blob_t
*
reference_blob_for_glyph
(
hb_codepoint_t
glyph_id
)
const
inline
hb_blob_t
*
reference_blob_for_glyph
(
hb_codepoint_t
glyph_id
)
const
{
{
if
(
unlikely
(
svg_len
==
0
))
if
(
unlikely
(
svg_len
==
0
))
return
hb_blob_get_empty
();
return
hb_blob_get_empty
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录