Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
3c69bd46
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
大约 1 年 前同步成功
通知
0
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3c69bd46
编写于
8月 17, 2009
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[HB] Avoid int overflow in GPOS
Bug 592036 - integer overflow bug causes misrendering of Nepali characters
上级
b2b18ef4
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
13 addition
and
10 deletion
+13
-10
src/hb-ot-layout-gpos-private.hh
src/hb-ot-layout-gpos-private.hh
+10
-10
src/hb-private.h
src/hb-private.h
+3
-0
未找到文件。
src/hb-ot-layout-gpos-private.hh
浏览文件 @
3c69bd46
...
...
@@ -102,13 +102,13 @@ struct ValueRecord {
y_scale
=
context
->
font
->
y_scale
;
/* design units -> fractional pixel */
if
(
format
&
xPlacement
)
glyph_pos
->
x_pos
+=
x_scale
*
*
(
SHORT
*
)
values
++
/
0x10000
;
glyph_pos
->
x_pos
+=
_hb_16dot16_mul_trunc
(
x_scale
,
*
(
SHORT
*
)
values
++
)
;
if
(
format
&
yPlacement
)
glyph_pos
->
y_pos
+=
y_scale
*
*
(
SHORT
*
)
values
++
/
0x10000
;
glyph_pos
->
y_pos
+=
_hb_16dot16_mul_trunc
(
y_scale
,
*
(
SHORT
*
)
values
++
)
;
if
(
format
&
xAdvance
)
glyph_pos
->
x_advance
+=
x_scale
*
*
(
SHORT
*
)
values
++
/
0x10000
;
glyph_pos
->
x_advance
+=
_hb_16dot16_mul_trunc
(
x_scale
,
*
(
SHORT
*
)
values
++
)
;
if
(
format
&
yAdvance
)
glyph_pos
->
y_advance
+=
y_scale
*
*
(
SHORT
*
)
values
++
/
0x10000
;
glyph_pos
->
y_advance
+=
_hb_16dot16_mul_trunc
(
y_scale
,
*
(
SHORT
*
)
values
++
)
;
x_ppem
=
context
->
font
->
x_ppem
;
y_ppem
=
context
->
font
->
y_ppem
;
...
...
@@ -150,8 +150,8 @@ struct AnchorFormat1
inline
void
get_anchor
(
hb_ot_layout_context_t
*
context
,
hb_codepoint_t
glyph_id
,
hb_position_t
*
x
,
hb_position_t
*
y
)
const
{
*
x
=
context
->
font
->
x_scale
*
xCoordinate
/
0x10000
;
*
y
=
context
->
font
->
y_scale
*
yCoordinate
/
0x10000
;
*
x
=
_hb_16dot16_mul_trunc
(
context
->
font
->
x_scale
,
xCoordinate
)
;
*
y
=
_hb_16dot16_mul_trunc
(
context
->
font
->
y_scale
,
yCoordinate
)
;
}
inline
bool
sanitize
(
SANITIZE_ARG_DEF
)
{
...
...
@@ -175,8 +175,8 @@ struct AnchorFormat2
hb_position_t
*
x
,
hb_position_t
*
y
)
const
{
/* TODO Contour */
*
x
=
context
->
font
->
x_scale
*
xCoordinate
/
0x10000
;
*
y
=
context
->
font
->
y_scale
*
yCoordinate
/
0x10000
;
*
x
=
_hb_16dot16_mul_trunc
(
context
->
font
->
x_scale
,
xCoordinate
)
;
*
y
=
_hb_16dot16_mul_trunc
(
context
->
font
->
y_scale
,
yCoordinate
)
;
}
inline
bool
sanitize
(
SANITIZE_ARG_DEF
)
{
...
...
@@ -200,8 +200,8 @@ struct AnchorFormat3
inline
void
get_anchor
(
hb_ot_layout_context_t
*
context
,
hb_codepoint_t
glyph_id
,
hb_position_t
*
x
,
hb_position_t
*
y
)
const
{
*
x
=
context
->
font
->
x_scale
*
xCoordinate
/
0x10000
;
*
y
=
context
->
font
->
y_scale
*
yCoordinate
/
0x10000
;
*
x
=
_hb_16dot16_mul_trunc
(
context
->
font
->
x_scale
,
xCoordinate
)
;
*
y
=
_hb_16dot16_mul_trunc
(
context
->
font
->
y_scale
,
yCoordinate
)
;
if
(
context
->
font
->
x_ppem
)
*
x
+=
(
this
+
xDeviceTable
).
get_delta
(
context
->
font
->
x_ppem
)
<<
6
;
...
...
src/hb-private.h
浏览文件 @
3c69bd46
...
...
@@ -201,6 +201,9 @@ _hb_popcount32 (uint32_t mask)
}
/* Multiplies a 16dot16 value by another value, then truncates the result */
#define _hb_16dot16_mul_trunc(A,B) ((int64_t) (A) * (B) / 0x10000)
#include "hb-object-private.h"
#endif
/* HB_PRIVATE_H */
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录