Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
e014405a
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看板
提交
e014405a
编写于
11月 12, 2018
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Rename check_array(array, a, b) to check_range()
上级
c8f4cc49
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
49 addition
and
18 deletion
+49
-18
src/hb-aat-layout-common.hh
src/hb-aat-layout-common.hh
+6
-2
src/hb-machinery.hh
src/hb-machinery.hh
+23
-8
src/hb-open-type.hh
src/hb-open-type.hh
+3
-1
src/hb-ot-layout-common.hh
src/hb-ot-layout-common.hh
+3
-2
src/hb-ot-layout-gpos-table.hh
src/hb-ot-layout-gpos-table.hh
+8
-3
src/hb-ot-var-hvar-table.hh
src/hb-ot-var-hvar-table.hh
+3
-1
src/hb-ot-var-mvar-table.hh
src/hb-ot-var-mvar-table.hh
+3
-1
未找到文件。
src/hb-aat-layout-common.hh
浏览文件 @
e014405a
...
...
@@ -557,7 +557,9 @@ struct StateTable
/* Negative states. */
if
(
unlikely
(
hb_unsigned_mul_overflows
(
min_state
,
num_classes
)))
return_trace
(
false
);
if
(
unlikely
(
!
c
->
check_array
(
&
states
[
min_state
*
num_classes
],
-
min_state
,
row_stride
)))
if
(
unlikely
(
!
c
->
check_range
(
&
states
[
min_state
*
num_classes
],
-
min_state
,
row_stride
)))
return_trace
(
false
);
if
((
c
->
max_ops
-=
state_neg
-
min_state
)
<
0
)
return_trace
(
false
);
...
...
@@ -574,7 +576,9 @@ struct StateTable
if
(
state_pos
<=
max_state
)
{
/* Positive states. */
if
(
unlikely
(
!
c
->
check_array
(
states
,
max_state
+
1
,
row_stride
)))
if
(
unlikely
(
!
c
->
check_range
(
states
,
max_state
+
1
,
row_stride
)))
return_trace
(
false
);
if
((
c
->
max_ops
-=
max_state
-
state_pos
+
1
)
<
0
)
return_trace
(
false
);
...
...
src/hb-machinery.hh
浏览文件 @
e014405a
...
...
@@ -316,23 +316,38 @@ struct hb_sanitize_context_t :
return
likely
(
ok
);
}
template
<
typename
T
>
inline
bool
check_range
(
const
T
*
base
,
unsigned
int
a
,
unsigned
int
b
)
const
{
return
!
hb_unsigned_mul_overflows
(
a
,
b
)
&&
this
->
check_range
(
base
,
a
*
b
);
}
template
<
typename
T
>
inline
bool
check_range
(
const
T
*
base
,
unsigned
int
a
,
unsigned
int
b
,
unsigned
int
c
)
const
{
return
!
hb_unsigned_mul_overflows
(
a
,
b
)
&&
this
->
check_range
(
base
,
a
*
b
,
c
);
}
template
<
typename
T
>
inline
bool
check_array
(
const
T
*
base
,
unsigned
int
len
,
unsigned
int
record_size
=
T
::
static_size
)
const
unsigned
int
len
)
const
{
return
!
hb_unsigned_mul_overflows
(
len
,
record_size
)
&&
this
->
check_range
(
base
,
len
*
record_size
);
return
this
->
check_range
(
base
,
len
,
T
::
static_size
);
}
template
<
typename
T
>
inline
bool
check_array2
(
const
T
*
base
,
unsigned
int
a
,
unsigned
int
b
,
unsigned
int
record_size
=
T
::
static_size
)
const
unsigned
int
b
)
const
{
return
!
hb_unsigned_mul_overflows
(
a
,
b
)
&&
this
->
check_array
(
base
,
a
*
b
,
record_size
);
return
this
->
check_range
(
base
,
a
*
b
,
T
::
static_size
);
}
template
<
typename
Type
>
...
...
src/hb-open-type.hh
浏览文件 @
e014405a
...
...
@@ -887,7 +887,9 @@ struct VarSizedBinSearchArrayOf
TRACE_SANITIZE
(
this
);
return_trace
(
header
.
sanitize
(
c
)
&&
Type
::
static_size
<=
header
.
unitSize
&&
c
->
check_array
(
bytesZ
.
arrayZ
,
header
.
nUnits
,
header
.
unitSize
));
c
->
check_range
(
bytesZ
.
arrayZ
,
header
.
nUnits
,
header
.
unitSize
));
}
protected:
...
...
src/hb-ot-layout-common.hh
浏览文件 @
e014405a
...
...
@@ -1566,8 +1566,9 @@ struct VarData
return_trace
(
c
->
check_struct
(
this
)
&&
regionIndices
.
sanitize
(
c
)
&&
shortCount
<=
regionIndices
.
len
&&
c
->
check_array
(
&
StructAfter
<
HBUINT8
>
(
regionIndices
),
itemCount
,
get_row_size
()));
c
->
check_range
(
&
StructAfter
<
HBUINT8
>
(
regionIndices
),
itemCount
,
get_row_size
()));
}
protected:
...
...
src/hb-ot-layout-gpos-table.hh
浏览文件 @
e014405a
...
...
@@ -207,7 +207,7 @@ struct ValueFormat : HBUINT16
TRACE_SANITIZE
(
this
);
unsigned
int
len
=
get_len
();
if
(
!
c
->
check_
array
(
values
,
count
,
get_size
()))
return_trace
(
false
);
if
(
!
c
->
check_
range
(
values
,
count
,
get_size
()))
return_trace
(
false
);
if
(
!
has_device
())
return_trace
(
true
);
...
...
@@ -706,7 +706,10 @@ struct PairSet
{
TRACE_SANITIZE
(
this
);
if
(
!
(
c
->
check_struct
(
this
)
&&
c
->
check_array
(
&
firstPairValueRecord
,
len
,
HBUINT16
::
static_size
*
closure
->
stride
)))
return_trace
(
false
);
&&
c
->
check_range
(
&
firstPairValueRecord
,
len
,
HBUINT16
::
static_size
,
closure
->
stride
)))
return_trace
(
false
);
unsigned
int
count
=
len
;
const
PairValueRecord
*
record
=
&
firstPairValueRecord
;
...
...
@@ -879,7 +882,9 @@ struct PairPosFormat2
unsigned
int
stride
=
len1
+
len2
;
unsigned
int
record_size
=
valueFormat1
.
get_size
()
+
valueFormat2
.
get_size
();
unsigned
int
count
=
(
unsigned
int
)
class1Count
*
(
unsigned
int
)
class2Count
;
return_trace
(
c
->
check_array
((
const
void
*
)
values
,
count
,
record_size
)
&&
return_trace
(
c
->
check_range
((
const
void
*
)
values
,
count
,
record_size
)
&&
valueFormat1
.
sanitize_values_stride_unsafe
(
c
,
this
,
&
values
[
0
],
count
,
stride
)
&&
valueFormat2
.
sanitize_values_stride_unsafe
(
c
,
this
,
&
values
[
len1
],
count
,
stride
));
}
...
...
src/hb-ot-var-hvar-table.hh
浏览文件 @
e014405a
...
...
@@ -39,7 +39,9 @@ struct DeltaSetIndexMap
{
TRACE_SANITIZE
(
this
);
return_trace
(
c
->
check_struct
(
this
)
&&
c
->
check_array
(
mapDataZ
.
arrayZ
,
mapCount
,
get_width
()));
c
->
check_range
(
mapDataZ
.
arrayZ
,
mapCount
,
get_width
()));
}
unsigned
int
map
(
unsigned
int
v
)
const
/* Returns 16.16 outer.inner. */
...
...
src/hb-ot-var-mvar-table.hh
浏览文件 @
e014405a
...
...
@@ -68,7 +68,9 @@ struct MVAR
c
->
check_struct
(
this
)
&&
valueRecordSize
>=
VariationValueRecord
::
static_size
&&
varStore
.
sanitize
(
c
,
this
)
&&
c
->
check_array
(
valuesZ
.
arrayZ
,
valueRecordCount
,
valueRecordSize
));
c
->
check_range
(
valuesZ
.
arrayZ
,
valueRecordCount
,
valueRecordSize
));
}
inline
float
get_var
(
hb_tag_t
tag
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录