Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
7cff75ba
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看板
提交
7cff75ba
编写于
5月 18, 2009
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[HB] Fix context_length checking
上级
d0ba0557
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
14 addition
and
11 deletion
+14
-11
src/hb-ot-layout-gsubgpos-private.h
src/hb-ot-layout-gsubgpos-private.h
+13
-10
src/hb-ot-layout-open-private.h
src/hb-ot-layout-open-private.h
+1
-1
未找到文件。
src/hb-ot-layout-gsubgpos-private.h
浏览文件 @
7cff75ba
...
...
@@ -79,13 +79,13 @@ static inline bool match_input (LOOKUP_ARGS_DEF,
unsigned
int
*
context_length_out
)
{
unsigned
int
i
,
j
;
/* XXX context_length should also be checked when skipping glyphs, right?
* What does context_length really mean, anyway? */
unsigned
int
end
=
MIN
(
buffer
->
in_length
,
buffer
->
in_pos
+
context_length
);
if
(
HB_UNLIKELY
(
buffer
->
in_pos
+
count
>
end
))
return
false
;
for
(
i
=
1
,
j
=
buffer
->
in_pos
+
1
;
i
<
count
;
i
++
,
j
++
)
{
while
(
!
_hb_ot_layout_check_glyph_property
(
layout
,
IN_ITEM
(
j
),
lookup_flag
,
&
property
))
{
if
(
HB_UNLIKELY
(
j
+
count
-
i
==
buffer
->
in_length
))
if
(
HB_UNLIKELY
(
j
+
count
-
i
==
end
))
return
false
;
j
++
;
}
...
...
@@ -105,9 +105,10 @@ static inline bool match_backtrack (LOOKUP_ARGS_DEF,
match_func_t
match_func
,
char
*
match_data
)
{
unsigned
int
i
,
j
;
if
(
HB_UNLIKELY
(
buffer
->
out_pos
<
count
))
return
false
;
for
(
i
=
0
,
j
=
buffer
->
out_pos
-
1
;
i
<
count
;
i
++
,
j
--
)
{
for
(
unsigned
int
i
=
0
,
j
=
buffer
->
out_pos
-
1
;
i
<
count
;
i
++
,
j
--
)
{
while
(
!
_hb_ot_layout_check_glyph_property
(
layout
,
OUT_ITEM
(
j
),
lookup_flag
,
&
property
))
{
if
(
HB_UNLIKELY
(
j
+
1
==
count
-
i
))
return
false
;
...
...
@@ -129,10 +130,13 @@ static inline bool match_lookahead (LOOKUP_ARGS_DEF,
unsigned
int
offset
)
{
unsigned
int
i
,
j
;
unsigned
int
end
=
MIN
(
buffer
->
in_length
,
buffer
->
in_pos
+
context_length
);
if
(
HB_UNLIKELY
(
buffer
->
in_pos
+
offset
+
count
>
end
))
return
false
;
for
(
i
=
0
,
j
=
buffer
->
in_pos
+
offset
;
i
<
count
;
i
++
,
j
++
)
{
while
(
!
_hb_ot_layout_check_glyph_property
(
layout
,
OUT_ITEM
(
j
),
lookup_flag
,
&
property
))
{
if
(
HB_UNLIKELY
(
j
+
count
-
i
==
buffer
->
in_length
))
if
(
HB_UNLIKELY
(
j
+
count
-
i
==
end
))
return
false
;
j
++
;
}
...
...
@@ -164,8 +168,8 @@ static inline bool apply_lookup (LOOKUP_ARGS_DEF,
const
LookupRecord
*
record
=
lookupRecord
;
/* XXX We have to jump non-matching glyphs when applying too, right? */
/*
XXX
We don't support lookupRecord arrays that are not increasing:
* Should be easy for in_place ones at least. */
/*
TODO
We don't support lookupRecord arrays that are not increasing:
*
Should be easy for in_place ones at least. */
for
(
unsigned
int
i
=
0
;
i
<
count
;)
{
if
(
record_count
&&
i
==
record
->
sequenceIndex
)
...
...
@@ -436,7 +440,6 @@ static inline bool chain_context_lookup (LOOKUP_ARGS_DEF,
inputCount
,
input
,
context
.
funcs
.
match
,
context
.
match_data
[
1
],
&
offset
)
&&
(
context_length
-=
offset
,
true
)
&&
match_lookahead
(
LOOKUP_ARGS
,
lookaheadCount
,
lookahead
,
context
.
funcs
.
match
,
context
.
match_data
[
2
],
...
...
src/hb-ot-layout-open-private.h
浏览文件 @
7cff75ba
...
...
@@ -35,7 +35,7 @@
#define NO_INDEX ((unsigned int) 0xFFFF)
#define NO_CONTEXT ((unsigned int) -
1
)
#define NO_CONTEXT ((unsigned int) -
0x20000
)
#define NOT_COVERED ((unsigned int) -1)
#define MAX_NESTING_LEVEL 32
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录