Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
d9dabc00
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看板
未验证
提交
d9dabc00
编写于
12月 05, 2018
作者:
B
Behdad Esfahbod
提交者:
GitHub
12月 05, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1454 from harfbuzz/cff-fixbcd
[CFF] fix oss-fuzz issue 11674: parse_bcd
上级
81cfd3c7
010e2ddb
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
37 addition
and
14 deletion
+37
-14
src/hb-cff-interp-dict-common.hh
src/hb-cff-interp-dict-common.hh
+37
-14
test/fuzzing/fonts/clusterfuzz-testcase-minimized-hb-subset-fuzzer-5672006905757696
...fuzz-testcase-minimized-hb-subset-fuzzer-5672006905757696
+0
-0
未找到文件。
src/hb-cff-interp-dict-common.hh
浏览文件 @
d9dabc00
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
#include "hb-cff-interp-common.hh"
#include "hb-cff-interp-common.hh"
#include <math.h>
#include <math.h>
#include <float.h>
namespace
CFF
{
namespace
CFF
{
...
@@ -105,20 +106,21 @@ struct DictOpSet : OpSet<Number>
...
@@ -105,20 +106,21 @@ struct DictOpSet : OpSet<Number>
static
inline
double
parse_bcd
(
SubByteStr
&
substr
)
static
inline
double
parse_bcd
(
SubByteStr
&
substr
)
{
{
double
v
=
0.0
;
bool
neg
=
false
;
bool
neg
=
false
;
double
int_part
=
0
;
double
int_part
=
0
;
long
frac_part
=
0
;
uint64_t
frac_part
=
0
;
u
nsigned
in
t
frac_count
=
0
;
u
int32_
t
frac_count
=
0
;
bool
exp_neg
=
false
;
bool
exp_neg
=
false
;
unsigned
int
exp_part
=
0
;
uint32_t
exp_part
=
0
;
bool
exp_overflow
=
false
;
enum
Part
{
INT_PART
=
0
,
FRAC_PART
,
EXP_PART
}
part
=
INT_PART
;
enum
Part
{
INT_PART
=
0
,
FRAC_PART
,
EXP_PART
}
part
=
INT_PART
;
enum
Nibble
{
DECIMAL
=
10
,
EXP_POS
,
EXP_NEG
,
RESERVED
,
NEG
,
END
};
enum
Nibble
{
DECIMAL
=
10
,
EXP_POS
,
EXP_NEG
,
RESERVED
,
NEG
,
END
};
const
uint64_t
MAX_FRACT
=
0xFFFFFFFFFFFFFllu
;
/* 1^52-1 */
const
uint32_t
MAX_EXP
=
0x7FFu
;
/* 1^11-1 */
double
value
=
0.0
;
double
value
=
0.0
;
unsigned
char
byte
=
0
;
unsigned
char
byte
=
0
;
for
(
u
nsigned
in
t
i
=
0
;;
i
++
)
for
(
u
int32_
t
i
=
0
;;
i
++
)
{
{
char
d
;
char
d
;
if
((
i
&
1
)
==
0
)
if
((
i
&
1
)
==
0
)
...
@@ -139,12 +141,25 @@ struct DictOpSet : OpSet<Number>
...
@@ -139,12 +141,25 @@ struct DictOpSet : OpSet<Number>
{
{
case
RESERVED
:
case
RESERVED
:
substr
.
set_error
();
substr
.
set_error
();
return
v
;
return
v
alue
;
case
END
:
case
END
:
value
=
(
double
)(
neg
?
-
int_part
:
int_part
);
value
=
(
double
)(
neg
?
-
int_part
:
int_part
);
if
(
frac_count
>
0
)
if
(
frac_count
>
0
)
value
+=
(
frac_part
/
pow
(
10.0
,
(
double
)
frac_count
));
{
double
frac
=
(
frac_part
/
pow
(
10.0
,
(
double
)
frac_count
));
if
(
neg
)
frac
=
-
frac
;
value
+=
frac
;
}
if
(
unlikely
(
exp_overflow
))
{
if
(
value
==
0.0
)
return
value
;
if
(
exp_neg
)
return
neg
?
-
DBL_MIN
:
DBL_MIN
;
else
return
neg
?
-
DBL_MAX
:
DBL_MAX
;
}
if
(
exp_part
!=
0
)
if
(
exp_part
!=
0
)
{
{
if
(
exp_neg
)
if
(
exp_neg
)
...
@@ -167,7 +182,7 @@ struct DictOpSet : OpSet<Number>
...
@@ -167,7 +182,7 @@ struct DictOpSet : OpSet<Number>
if
(
part
!=
INT_PART
)
if
(
part
!=
INT_PART
)
{
{
substr
.
set_error
();
substr
.
set_error
();
return
v
;
return
v
alue
;
}
}
part
=
FRAC_PART
;
part
=
FRAC_PART
;
break
;
break
;
...
@@ -180,7 +195,7 @@ struct DictOpSet : OpSet<Number>
...
@@ -180,7 +195,7 @@ struct DictOpSet : OpSet<Number>
if
(
part
==
EXP_PART
)
if
(
part
==
EXP_PART
)
{
{
substr
.
set_error
();
substr
.
set_error
();
return
v
;
return
v
alue
;
}
}
part
=
EXP_PART
;
part
=
EXP_PART
;
break
;
break
;
...
@@ -193,18 +208,26 @@ struct DictOpSet : OpSet<Number>
...
@@ -193,18 +208,26 @@ struct DictOpSet : OpSet<Number>
break
;
break
;
case
FRAC_PART
:
case
FRAC_PART
:
frac_part
=
(
frac_part
*
10
)
+
d
;
if
(
likely
((
frac_part
<=
MAX_FRACT
/
10
)))
frac_count
++
;
{
frac_part
=
(
frac_part
*
10
)
+
(
unsigned
)
d
;
frac_count
++
;
}
break
;
break
;
case
EXP_PART
:
case
EXP_PART
:
exp_part
=
(
exp_part
*
10
)
+
d
;
if
(
likely
(
exp_part
*
10
)
+
d
<=
MAX_EXP
)
{
exp_part
=
(
exp_part
*
10
)
+
d
;
}
else
exp_overflow
=
true
;
break
;
break
;
}
}
}
}
}
}
return
v
;
return
v
alue
;
}
}
static
inline
bool
is_hint_op
(
OpCode
op
)
static
inline
bool
is_hint_op
(
OpCode
op
)
...
...
test/fuzzing/fonts/clusterfuzz-testcase-minimized-hb-subset-fuzzer-5672006905757696
0 → 100644
浏览文件 @
d9dabc00
文件已添加
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录