Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
天中雨水
rt-thread
提交
2fc33973
R
rt-thread
项目概览
天中雨水
/
rt-thread
该项目与 Fork 源项目分叉
Fork自
RT-Thread / rt-thread
通知
2
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2fc33973
编写于
6月 12, 2015
作者:
B
Bernard Xiong
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #502 from grissiom/fix-freetype
Fix freetype
上级
390c8247
e12dd584
变更
66
展开全部
隐藏空白更改
内联
并排
Showing
66 changed file
with
1356 addition
and
1295 deletion
+1356
-1295
components/external/freetype/builds/rt-thread/gb2312tounicode.c
...ents/external/freetype/builds/rt-thread/gb2312tounicode.c
+5
-5
components/external/freetype/include/internal/ftvalid.h
components/external/freetype/include/internal/ftvalid.h
+11
-13
components/external/freetype/src/autofit/afmodule.c
components/external/freetype/src/autofit/afmodule.c
+1
-1
components/external/freetype/src/base/ftbbox.c
components/external/freetype/src/base/ftbbox.c
+19
-15
components/external/freetype/src/base/ftbitmap.c
components/external/freetype/src/base/ftbitmap.c
+1
-1
components/external/freetype/src/base/ftcalc.c
components/external/freetype/src/base/ftcalc.c
+21
-20
components/external/freetype/src/base/ftobjs.c
components/external/freetype/src/base/ftobjs.c
+5
-3
components/external/freetype/src/base/ftrfork.c
components/external/freetype/src/base/ftrfork.c
+4
-4
components/external/freetype/src/base/ftstroke.c
components/external/freetype/src/base/ftstroke.c
+2
-2
components/external/freetype/src/base/fttrigon.c
components/external/freetype/src/base/fttrigon.c
+6
-6
components/external/freetype/src/bdf/bdflib.c
components/external/freetype/src/bdf/bdflib.c
+8
-8
components/external/freetype/src/bzip2/ftbzip2.c
components/external/freetype/src/bzip2/ftbzip2.c
+1
-1
components/external/freetype/src/cff/cf2font.c
components/external/freetype/src/cff/cf2font.c
+2
-2
components/external/freetype/src/cff/cffdrivr.c
components/external/freetype/src/cff/cffdrivr.c
+2
-2
components/external/freetype/src/cff/cffparse.c
components/external/freetype/src/cff/cffparse.c
+1
-1
components/external/freetype/src/gxvalid/gxvbsln.c
components/external/freetype/src/gxvalid/gxvbsln.c
+28
-28
components/external/freetype/src/gxvalid/gxvcommn.c
components/external/freetype/src/gxvalid/gxvcommn.c
+137
-137
components/external/freetype/src/gxvalid/gxvcommn.h
components/external/freetype/src/gxvalid/gxvcommn.h
+39
-39
components/external/freetype/src/gxvalid/gxvfeat.c
components/external/freetype/src/gxvalid/gxvfeat.c
+19
-19
components/external/freetype/src/gxvalid/gxvjust.c
components/external/freetype/src/gxvalid/gxvjust.c
+94
-94
components/external/freetype/src/gxvalid/gxvkern.c
components/external/freetype/src/gxvalid/gxvkern.c
+76
-76
components/external/freetype/src/gxvalid/gxvlcar.c
components/external/freetype/src/gxvalid/gxvlcar.c
+18
-18
components/external/freetype/src/gxvalid/gxvmort.c
components/external/freetype/src/gxvalid/gxvmort.c
+22
-22
components/external/freetype/src/gxvalid/gxvmort.h
components/external/freetype/src/gxvalid/gxvmort.h
+7
-7
components/external/freetype/src/gxvalid/gxvmort0.c
components/external/freetype/src/gxvalid/gxvmort0.c
+8
-8
components/external/freetype/src/gxvalid/gxvmort1.c
components/external/freetype/src/gxvalid/gxvmort1.c
+27
-27
components/external/freetype/src/gxvalid/gxvmort2.c
components/external/freetype/src/gxvalid/gxvmort2.c
+23
-23
components/external/freetype/src/gxvalid/gxvmort4.c
components/external/freetype/src/gxvalid/gxvmort4.c
+9
-9
components/external/freetype/src/gxvalid/gxvmort5.c
components/external/freetype/src/gxvalid/gxvmort5.c
+15
-15
components/external/freetype/src/gxvalid/gxvmorx.c
components/external/freetype/src/gxvalid/gxvmorx.c
+15
-15
components/external/freetype/src/gxvalid/gxvmorx.h
components/external/freetype/src/gxvalid/gxvmorx.h
+5
-5
components/external/freetype/src/gxvalid/gxvmorx0.c
components/external/freetype/src/gxvalid/gxvmorx0.c
+8
-8
components/external/freetype/src/gxvalid/gxvmorx1.c
components/external/freetype/src/gxvalid/gxvmorx1.c
+25
-25
components/external/freetype/src/gxvalid/gxvmorx2.c
components/external/freetype/src/gxvalid/gxvmorx2.c
+24
-24
components/external/freetype/src/gxvalid/gxvmorx4.c
components/external/freetype/src/gxvalid/gxvmorx4.c
+2
-2
components/external/freetype/src/gxvalid/gxvmorx5.c
components/external/freetype/src/gxvalid/gxvmorx5.c
+17
-17
components/external/freetype/src/gxvalid/gxvopbd.c
components/external/freetype/src/gxvalid/gxvopbd.c
+16
-16
components/external/freetype/src/gxvalid/gxvprop.c
components/external/freetype/src/gxvalid/gxvprop.c
+19
-19
components/external/freetype/src/gxvalid/gxvtrak.c
components/external/freetype/src/gxvalid/gxvtrak.c
+23
-23
components/external/freetype/src/gzip/ftgzip.c
components/external/freetype/src/gzip/ftgzip.c
+2
-2
components/external/freetype/src/lzw/ftlzw.c
components/external/freetype/src/lzw/ftlzw.c
+2
-2
components/external/freetype/src/lzw/ftzopen.h
components/external/freetype/src/lzw/ftzopen.h
+1
-1
components/external/freetype/src/otvalid/otvbase.c
components/external/freetype/src/otvalid/otvbase.c
+25
-25
components/external/freetype/src/otvalid/otvcommn.c
components/external/freetype/src/otvalid/otvcommn.c
+85
-85
components/external/freetype/src/otvalid/otvcommn.h
components/external/freetype/src/otvalid/otvcommn.h
+79
-79
components/external/freetype/src/otvalid/otvgdef.c
components/external/freetype/src/otvalid/otvgdef.c
+18
-18
components/external/freetype/src/otvalid/otvgpos.c
components/external/freetype/src/otvalid/otvgpos.c
+93
-93
components/external/freetype/src/otvalid/otvgsub.c
components/external/freetype/src/otvalid/otvgsub.c
+54
-54
components/external/freetype/src/otvalid/otvjstf.c
components/external/freetype/src/otvalid/otvjstf.c
+42
-41
components/external/freetype/src/otvalid/otvmath.c
components/external/freetype/src/otvalid/otvmath.c
+36
-36
components/external/freetype/src/pcf/pcfread.c
components/external/freetype/src/pcf/pcfread.c
+44
-11
components/external/freetype/src/pfr/pfrload.c
components/external/freetype/src/pfr/pfrload.c
+1
-1
components/external/freetype/src/psaux/psconv.c
components/external/freetype/src/psaux/psconv.c
+3
-3
components/external/freetype/src/psnames/psmodule.c
components/external/freetype/src/psnames/psmodule.c
+2
-2
components/external/freetype/src/sfnt/sfdriver.c
components/external/freetype/src/sfnt/sfdriver.c
+1
-1
components/external/freetype/src/sfnt/ttcmap.c
components/external/freetype/src/sfnt/ttcmap.c
+1
-1
components/external/freetype/src/smooth/ftgrays.c
components/external/freetype/src/smooth/ftgrays.c
+2
-2
components/external/freetype/src/tools/docmaker/formatter.py
components/external/freetype/src/tools/docmaker/formatter.py
+1
-1
components/external/freetype/src/tools/docmaker/tohtml.py
components/external/freetype/src/tools/docmaker/tohtml.py
+1
-1
components/external/freetype/src/tools/ftrandom/ftrandom.c
components/external/freetype/src/tools/ftrandom/ftrandom.c
+2
-2
components/external/freetype/src/tools/test_trig.c
components/external/freetype/src/tools/test_trig.c
+8
-8
components/external/freetype/src/truetype/ttdriver.c
components/external/freetype/src/truetype/ttdriver.c
+1
-1
components/external/freetype/src/truetype/ttinterp.c
components/external/freetype/src/truetype/ttinterp.c
+7
-7
components/external/freetype/src/truetype/ttobjs.c
components/external/freetype/src/truetype/ttobjs.c
+62
-53
components/external/freetype/src/type42/t42parse.c
components/external/freetype/src/type42/t42parse.c
+13
-0
components/external/freetype/src/winfonts/winfnt.c
components/external/freetype/src/winfonts/winfnt.c
+5
-5
未找到文件。
components/external/freetype/builds/rt-thread/gb2312tounicode.c
浏览文件 @
2fc33973
...
@@ -895,7 +895,7 @@ rt_uint32_t gb2312tounicode(const rt_uint16_t key)
...
@@ -895,7 +895,7 @@ rt_uint32_t gb2312tounicode(const rt_uint16_t key)
if
(
key
<
0x80
)
if
(
key
<
0x80
)
return
key
;
return
key
;
if
(
key
<
0xA1A1
)
if
(
key
<
0xA1A1
)
return
-
1
;
return
(
rt_uint32_t
)
-
1
;
sec
=
(
lc
>>
8
)
-
0xA0
;
sec
=
(
lc
>>
8
)
-
0xA0
;
...
@@ -911,11 +911,11 @@ rt_uint32_t gb2312tounicode(const rt_uint16_t key)
...
@@ -911,11 +911,11 @@ rt_uint32_t gb2312tounicode(const rt_uint16_t key)
return
gb2312uni_table
[
key
-
ps
->
range
[
i
].
start
+
ps
->
range
[
i
].
offset
];
return
gb2312uni_table
[
key
-
ps
->
range
[
i
].
start
+
ps
->
range
[
i
].
offset
];
}
}
}
}
return
-
1
;
return
(
rt_uint32_t
)
-
1
;
}
}
else
if
(
sec
<
16
)
/* No code in section 10~15. */
else
if
(
sec
<
16
)
/* No code in section 10~15. */
{
{
return
-
1
;
return
(
rt_uint32_t
)
-
1
;
}
}
else
if
(
sec
<
88
)
/* Section 16~87. */
else
if
(
sec
<
88
)
/* Section 16~87. */
{
{
...
@@ -926,7 +926,7 @@ rt_uint32_t gb2312tounicode(const rt_uint16_t key)
...
@@ -926,7 +926,7 @@ rt_uint32_t gb2312tounicode(const rt_uint16_t key)
{
{
/* Section 55 only have chars up to 0xD7F9. */
/* Section 55 only have chars up to 0xD7F9. */
if
(
sec
==
55
&&
key
>
0xD7F9
)
if
(
sec
==
55
&&
key
>
0xD7F9
)
return
-
1
;
return
(
rt_uint32_t
)
-
1
;
/* There are 682 chars before section 16 in GB2312(not GBK). And all
/* There are 682 chars before section 16 in GB2312(not GBK). And all
* these sections are full(no wholes). */
* these sections are full(no wholes). */
code
+=
682
;
code
+=
682
;
...
@@ -941,6 +941,6 @@ rt_uint32_t gb2312tounicode(const rt_uint16_t key)
...
@@ -941,6 +941,6 @@ rt_uint32_t gb2312tounicode(const rt_uint16_t key)
}
}
else
else
{
{
return
-
1
;
return
(
rt_uint32_t
)
-
1
;
}
}
}
}
components/external/freetype/include/internal/ftvalid.h
浏览文件 @
2fc33973
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
/* */
/* */
/* FreeType validation support (specification). */
/* FreeType validation support (specification). */
/* */
/* */
/* Copyright 2004, 2013
by
*/
/* Copyright 2004, 2013
, 2014 by
*/
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* This file is part of the FreeType project, and may only be used, */
...
@@ -87,13 +87,13 @@ FT_BEGIN_HEADER
...
@@ -87,13 +87,13 @@ FT_BEGIN_HEADER
/* validator structure */
/* validator structure */
typedef
struct
FT_ValidatorRec_
typedef
struct
FT_ValidatorRec_
{
{
ft_jmp_buf
jump_buffer
;
/* used for exception handling */
const
FT_Byte
*
base
;
/* address of table in memory */
const
FT_Byte
*
base
;
/* address of table in memory */
const
FT_Byte
*
limit
;
/* `base' + sizeof(table) in memory */
const
FT_Byte
*
limit
;
/* `base' + sizeof(table) in memory */
FT_ValidationLevel
level
;
/* validation level */
FT_ValidationLevel
level
;
/* validation level */
FT_Error
error
;
/* error returned. 0 means success */
FT_Error
error
;
/* error returned. 0 means success */
ft_jmp_buf
jump_buffer
;
/* used for exception handling */
}
FT_ValidatorRec
;
}
FT_ValidatorRec
;
#if defined( _MSC_VER )
#if defined( _MSC_VER )
...
@@ -126,31 +126,29 @@ FT_BEGIN_HEADER
...
@@ -126,31 +126,29 @@ FT_BEGIN_HEADER
/* Calls ft_validate_error. Assumes that the `valid' local variable */
/* Calls ft_validate_error. Assumes that the `valid' local variable */
/* holds a pointer to the current validator object. */
/* holds a pointer to the current validator object. */
/* */
/* */
/* Use preprocessor prescan to pass FT_ERR_PREFIX. */
#define FT_INVALID( _error ) FT_INVALID_( _error )
/* */
#define FT_INVALID_( _error ) \
#define FT_INVALID( _prefix, _error ) FT_INVALID_( _prefix, _error )
ft_validator_error( valid, FT_THROW( _error ) )
#define FT_INVALID_( _prefix, _error ) \
ft_validator_error( valid, _prefix ## _error )
/* called when a broken table is detected */
/* called when a broken table is detected */
#define FT_INVALID_TOO_SHORT \
#define FT_INVALID_TOO_SHORT \
FT_INVALID(
FT_ERR_PREFIX,
Invalid_Table )
FT_INVALID( Invalid_Table )
/* called when an invalid offset is detected */
/* called when an invalid offset is detected */
#define FT_INVALID_OFFSET \
#define FT_INVALID_OFFSET \
FT_INVALID(
FT_ERR_PREFIX,
Invalid_Offset )
FT_INVALID( Invalid_Offset )
/* called when an invalid format/value is detected */
/* called when an invalid format/value is detected */
#define FT_INVALID_FORMAT \
#define FT_INVALID_FORMAT \
FT_INVALID(
FT_ERR_PREFIX,
Invalid_Table )
FT_INVALID( Invalid_Table )
/* called when an invalid glyph index is detected */
/* called when an invalid glyph index is detected */
#define FT_INVALID_GLYPH_ID \
#define FT_INVALID_GLYPH_ID \
FT_INVALID(
FT_ERR_PREFIX,
Invalid_Glyph_Index )
FT_INVALID( Invalid_Glyph_Index )
/* called when an invalid field value is detected */
/* called when an invalid field value is detected */
#define FT_INVALID_DATA \
#define FT_INVALID_DATA \
FT_INVALID(
FT_ERR_PREFIX,
Invalid_Table )
FT_INVALID( Invalid_Table )
FT_END_HEADER
FT_END_HEADER
...
...
components/external/freetype/src/autofit/afmodule.c
浏览文件 @
2fc33973
...
@@ -226,7 +226,7 @@
...
@@ -226,7 +226,7 @@
af_get_interface
(
FT_Module
module
,
af_get_interface
(
FT_Module
module
,
const
char
*
module_interface
)
const
char
*
module_interface
)
{
{
/* AF_SERVICES_GET derefers `library' in PIC mode */
/* AF_SERVICES_GET derefer
ence
s `library' in PIC mode */
#ifdef FT_CONFIG_OPTION_PIC
#ifdef FT_CONFIG_OPTION_PIC
FT_Library
library
;
FT_Library
library
;
...
...
components/external/freetype/src/base/ftbbox.c
浏览文件 @
2fc33973
...
@@ -42,22 +42,22 @@
...
@@ -42,22 +42,22 @@
}
TBBox_Rec
;
}
TBBox_Rec
;
#define FT_UPDATE_BBOX(
p, bbox)
\
#define FT_UPDATE_BBOX(
p, bbox )
\
FT_BEGIN_STMNT
\
FT_BEGIN_STMNT \
if ( p->x < bbox.xMin )
\
if ( p->x < bbox.xMin ) \
bbox.xMin = p->x;
\
bbox.xMin = p->x; \
if ( p->x > bbox.xMax )
\
if ( p->x > bbox.xMax ) \
bbox.xMax = p->x;
\
bbox.xMax = p->x; \
if ( p->y < bbox.yMin )
\
if ( p->y < bbox.yMin ) \
bbox.yMin = p->y;
\
bbox.yMin = p->y; \
if ( p->y > bbox.yMax )
\
if ( p->y > bbox.yMax ) \
bbox.yMax = p->y;
\
bbox.yMax = p->y; \
FT_END_STMNT
FT_END_STMNT
#define CHECK_X( p, bbox ) \
#define CHECK_X( p, bbox )
\
( p->x < bbox.xMin || p->x > bbox.xMax )
( p->x < bbox.xMin || p->x > bbox.xMax )
#define CHECK_Y( p, bbox ) \
#define CHECK_Y( p, bbox )
\
( p->y < bbox.yMin || p->y > bbox.yMax )
( p->y < bbox.yMin || p->y > bbox.yMax )
...
@@ -419,7 +419,8 @@
...
@@ -419,7 +419,8 @@
return
0
;
return
0
;
}
}
FT_DEFINE_OUTLINE_FUNCS
(
bbox_interface
,
FT_DEFINE_OUTLINE_FUNCS
(
bbox_interface
,
(
FT_Outline_MoveTo_Func
)
BBox_Move_To
,
(
FT_Outline_MoveTo_Func
)
BBox_Move_To
,
(
FT_Outline_LineTo_Func
)
BBox_Line_To
,
(
FT_Outline_LineTo_Func
)
BBox_Line_To
,
(
FT_Outline_ConicTo_Func
)
BBox_Conic_To
,
(
FT_Outline_ConicTo_Func
)
BBox_Conic_To
,
...
@@ -427,14 +428,17 @@ FT_DEFINE_OUTLINE_FUNCS(bbox_interface,
...
@@ -427,14 +428,17 @@ FT_DEFINE_OUTLINE_FUNCS(bbox_interface,
0
,
0
0
,
0
)
)
/* documentation is in ftbbox.h */
/* documentation is in ftbbox.h */
FT_EXPORT_DEF
(
FT_Error
)
FT_EXPORT_DEF
(
FT_Error
)
FT_Outline_Get_BBox
(
FT_Outline
*
outline
,
FT_Outline_Get_BBox
(
FT_Outline
*
outline
,
FT_BBox
*
abbox
)
FT_BBox
*
abbox
)
{
{
FT_BBox
cbox
=
{
0x7FFFFFFF
,
0x7FFFFFFF
,
-
0x7FFFFFFF
,
-
0x7FFFFFFF
};
FT_BBox
cbox
=
{
0x7FFFFFFFL
,
0x7FFFFFFFL
,
FT_BBox
bbox
=
{
0x7FFFFFFF
,
0x7FFFFFFF
,
-
0x7FFFFFFF
,
-
0x7FFFFFFF
};
-
0x7FFFFFFFL
,
-
0x7FFFFFFFL
};
FT_BBox
bbox
=
{
0x7FFFFFFFL
,
0x7FFFFFFFL
,
-
0x7FFFFFFFL
,
-
0x7FFFFFFFL
};
FT_Vector
*
vec
;
FT_Vector
*
vec
;
FT_UShort
n
;
FT_UShort
n
;
...
...
components/external/freetype/src/base/ftbitmap.c
浏览文件 @
2fc33973
...
@@ -363,7 +363,7 @@
...
@@ -363,7 +363,7 @@
p
[
x
]
|=
p
[
x
-
1
]
<<
(
8
-
i
);
p
[
x
]
|=
p
[
x
-
1
]
<<
(
8
-
i
);
#if 0
#if 0
if ( p[x] == 0x
ff
)
if ( p[x] == 0x
FF
)
break;
break;
#endif
#endif
}
}
...
...
components/external/freetype/src/base/ftcalc.c
浏览文件 @
2fc33973
...
@@ -86,8 +86,8 @@
...
@@ -86,8 +86,8 @@
FT_EXPORT_DEF
(
FT_Fixed
)
FT_EXPORT_DEF
(
FT_Fixed
)
FT_RoundFix
(
FT_Fixed
a
)
FT_RoundFix
(
FT_Fixed
a
)
{
{
return
(
a
>=
0
)
?
(
a
+
0x8000L
)
&
~
0xFFFFL
return
a
>=
0
?
(
a
+
0x8000L
)
&
~
0xFFFFL
:
-
((
-
a
+
0x8000L
)
&
~
0xFFFFL
);
:
-
((
-
a
+
0x8000L
)
&
~
0xFFFFL
);
}
}
...
@@ -96,8 +96,8 @@
...
@@ -96,8 +96,8 @@
FT_EXPORT_DEF
(
FT_Fixed
)
FT_EXPORT_DEF
(
FT_Fixed
)
FT_CeilFix
(
FT_Fixed
a
)
FT_CeilFix
(
FT_Fixed
a
)
{
{
return
(
a
>=
0
)
?
(
a
+
0xFFFFL
)
&
~
0xFFFFL
return
a
>=
0
?
(
a
+
0xFFFFL
)
&
~
0xFFFFL
:
-
((
-
a
+
0xFFFFL
)
&
~
0xFFFFL
);
:
-
((
-
a
+
0xFFFFL
)
&
~
0xFFFFL
);
}
}
...
@@ -106,8 +106,8 @@
...
@@ -106,8 +106,8 @@
FT_EXPORT_DEF
(
FT_Fixed
)
FT_EXPORT_DEF
(
FT_Fixed
)
FT_FloorFix
(
FT_Fixed
a
)
FT_FloorFix
(
FT_Fixed
a
)
{
{
return
(
a
>=
0
)
?
a
&
~
0xFFFFL
return
a
>=
0
?
a
&
~
0xFFFFL
:
-
((
-
a
)
&
~
0xFFFFL
);
:
-
((
-
a
)
&
~
0xFFFFL
);
}
}
#ifndef FT_MSB
#ifndef FT_MSB
...
@@ -115,30 +115,31 @@
...
@@ -115,30 +115,31 @@
FT_BASE_DEF
(
FT_Int
)
FT_BASE_DEF
(
FT_Int
)
FT_MSB
(
FT_UInt32
z
)
FT_MSB
(
FT_UInt32
z
)
{
{
FT_Int
shift
=
0
;
FT_Int
shift
=
0
;
/* determine msb bit index in `shift' */
/* determine msb bit index in `shift' */
if
(
z
&
0xFFFF0000U
)
if
(
z
&
0xFFFF0000U
L
)
{
{
z
>>=
16
;
z
>>=
16
;
shift
+=
16
;
shift
+=
16
;
}
}
if
(
z
&
0x0000FF00U
)
if
(
z
&
0x0000FF00U
L
)
{
{
z
>>=
8
;
z
>>=
8
;
shift
+=
8
;
shift
+=
8
;
}
}
if
(
z
&
0x000000F0U
)
if
(
z
&
0x000000F0U
L
)
{
{
z
>>=
4
;
z
>>=
4
;
shift
+=
4
;
shift
+=
4
;
}
}
if
(
z
&
0x0000000CU
)
if
(
z
&
0x0000000CU
L
)
{
{
z
>>=
2
;
z
>>=
2
;
shift
+=
2
;
shift
+=
2
;
}
}
if
(
z
&
0x00000002U
)
if
(
z
&
0x00000002U
L
)
{
{
/* z >>= 1; */
/* z >>= 1; */
shift
+=
1
;
shift
+=
1
;
...
@@ -187,7 +188,7 @@
...
@@ -187,7 +188,7 @@
d
=
(
FT_Long
)(
c
>
0
?
(
(
FT_Int64
)
a
*
b
+
(
c
>>
1
)
)
/
c
d
=
(
FT_Long
)(
c
>
0
?
(
(
FT_Int64
)
a
*
b
+
(
c
>>
1
)
)
/
c
:
0x7FFFFFFFL
);
:
0x7FFFFFFFL
);
return
(
s
>
0
)
?
d
:
-
d
;
return
s
<
0
?
-
d
:
d
;
}
}
...
@@ -209,7 +210,7 @@
...
@@ -209,7 +210,7 @@
d
=
(
FT_Long
)(
c
>
0
?
(
FT_Int64
)
a
*
b
/
c
d
=
(
FT_Long
)(
c
>
0
?
(
FT_Int64
)
a
*
b
/
c
:
0x7FFFFFFFL
);
:
0x7FFFFFFFL
);
return
(
s
>
0
)
?
d
:
-
d
;
return
s
<
0
?
-
d
:
d
;
}
}
...
@@ -234,7 +235,7 @@
...
@@ -234,7 +235,7 @@
c
=
(
FT_Long
)(
(
(
FT_Int64
)
a
*
b
+
0x8000L
)
>>
16
);
c
=
(
FT_Long
)(
(
(
FT_Int64
)
a
*
b
+
0x8000L
)
>>
16
);
return
(
s
>
0
)
?
c
:
-
c
;
return
s
<
0
?
-
c
:
c
;
#endif
/* FT_MULFIX_ASSEMBLER */
#endif
/* FT_MULFIX_ASSEMBLER */
}
}
...
@@ -256,7 +257,7 @@
...
@@ -256,7 +257,7 @@
q
=
(
FT_Long
)(
b
>
0
?
(
(
(
FT_UInt64
)
a
<<
16
)
+
(
b
>>
1
)
)
/
b
q
=
(
FT_Long
)(
b
>
0
?
(
(
(
FT_UInt64
)
a
<<
16
)
+
(
b
>>
1
)
)
/
b
:
0x7FFFFFFFL
);
:
0x7FFFFFFFL
);
return
(
s
<
0
?
-
q
:
q
)
;
return
s
<
0
?
-
q
:
q
;
}
}
...
@@ -438,7 +439,7 @@
...
@@ -438,7 +439,7 @@
:
ft_div64by32
(
temp
.
hi
,
temp
.
lo
,
c
);
:
ft_div64by32
(
temp
.
hi
,
temp
.
lo
,
c
);
}
}
return
(
s
<
0
?
-
a
:
a
)
;
return
s
<
0
?
-
a
:
a
;
}
}
...
@@ -475,7 +476,7 @@
...
@@ -475,7 +476,7 @@
:
ft_div64by32
(
temp
.
hi
,
temp
.
lo
,
c
);
:
ft_div64by32
(
temp
.
hi
,
temp
.
lo
,
c
);
}
}
return
(
s
<
0
?
-
a
:
a
)
;
return
s
<
0
?
-
a
:
a
;
}
}
...
@@ -573,7 +574,7 @@
...
@@ -573,7 +574,7 @@
(
(
al
*
(
ub
&
0xFFFFUL
)
+
0x8000UL
)
>>
16
);
(
(
al
*
(
ub
&
0xFFFFUL
)
+
0x8000UL
)
>>
16
);
}
}
return
(
s
<
0
?
-
(
FT_Long
)
ua
:
(
FT_Long
)
ua
)
;
return
s
<
0
?
-
(
FT_Long
)
ua
:
(
FT_Long
)
ua
;
#endif
/* 0 */
#endif
/* 0 */
...
@@ -620,7 +621,7 @@
...
@@ -620,7 +621,7 @@
q
=
(
FT_Long
)
ft_div64by32
(
temp
.
hi
,
temp
.
lo
,
b
);
q
=
(
FT_Long
)
ft_div64by32
(
temp
.
hi
,
temp
.
lo
,
b
);
}
}
return
(
s
<
0
?
-
q
:
q
)
;
return
s
<
0
?
-
q
:
q
;
}
}
...
...
components/external/freetype/src/base/ftobjs.c
浏览文件 @
2fc33973
...
@@ -1910,7 +1910,7 @@
...
@@ -1910,7 +1910,7 @@
rlen = ( header[0x57] << 24 ) |
rlen = ( header[0x57] << 24 ) |
( header[0x58] << 16 ) |
( header[0x58] << 16 ) |
( header[0x59] << 8 ) |
( header[0x59] << 8 ) |
header[0x5
a
];
header[0x5
A
];
#endif /* 0 */
#endif /* 0 */
offset
=
128
+
(
(
dlen
+
127
)
&
~
127
);
offset
=
128
+
(
(
dlen
+
127
)
&
~
127
);
...
@@ -3648,8 +3648,10 @@
...
@@ -3648,8 +3648,10 @@
/* clean up buffer */
/* clean up buffer */
((
FT_Byte
*
)
buffer
)[
0
]
=
'\0'
;
((
FT_Byte
*
)
buffer
)[
0
]
=
'\0'
;
if
(
(
FT_Long
)
glyph_index
>
face
->
num_glyphs
||
if
(
(
FT_Long
)
glyph_index
>=
face
->
num_glyphs
)
!
FT_HAS_GLYPH_NAMES
(
face
)
)
return
FT_THROW
(
Invalid_Glyph_Index
);
if
(
!
FT_HAS_GLYPH_NAMES
(
face
)
)
return
FT_THROW
(
Invalid_Argument
);
return
FT_THROW
(
Invalid_Argument
);
FT_FACE_LOOKUP_SERVICE
(
face
,
service
,
GLYPH_DICT
);
FT_FACE_LOOKUP_SERVICE
(
face
,
service
,
GLYPH_DICT
);
...
...
components/external/freetype/src/base/ftrfork.c
浏览文件 @
2fc33973
...
@@ -182,10 +182,10 @@
...
@@ -182,10 +182,10 @@
return
error
;
return
error
;
FT_TRACE2
((
"Resource tags: %c%c%c%c
\n
"
,
FT_TRACE2
((
"Resource tags: %c%c%c%c
\n
"
,
(
char
)(
0x
ff
&
(
tag_internal
>>
24
)
),
(
char
)(
0x
FF
&
(
tag_internal
>>
24
)
),
(
char
)(
0x
ff
&
(
tag_internal
>>
16
)
),
(
char
)(
0x
FF
&
(
tag_internal
>>
16
)
),
(
char
)(
0x
ff
&
(
tag_internal
>>
8
)
),
(
char
)(
0x
FF
&
(
tag_internal
>>
8
)
),
(
char
)(
0x
ff
&
(
tag_internal
>>
0
)
)
));
(
char
)(
0x
FF
&
(
tag_internal
>>
0
)
)
));
FT_TRACE3
((
" : subcount=%d, suboffset=0x%04x
\n
"
,
FT_TRACE3
((
" : subcount=%d, suboffset=0x%04x
\n
"
,
subcnt
,
rpos
));
subcnt
,
rpos
));
...
...
components/external/freetype/src/base/ftstroke.c
浏览文件 @
2fc33973
...
@@ -834,8 +834,8 @@
...
@@ -834,8 +834,8 @@
stroker
->
miter_limit
=
miter_limit
;
stroker
->
miter_limit
=
miter_limit
;
/* ensure miter limit has sensible value */
/* ensure miter limit has sensible value */
if
(
stroker
->
miter_limit
<
0x10000
)
if
(
stroker
->
miter_limit
<
0x10000
L
)
stroker
->
miter_limit
=
0x10000
;
stroker
->
miter_limit
=
0x10000
L
;
/* save line join style: */
/* save line join style: */
/* line join style can be temporarily changed when stroking curves */
/* line join style can be temporarily changed when stroking curves */
...
...
components/external/freetype/src/base/fttrigon.c
浏览文件 @
2fc33973
...
@@ -73,7 +73,7 @@
...
@@ -73,7 +73,7 @@
/* and CORDIC hypotenuse, so it minimizes the error */
/* and CORDIC hypotenuse, so it minimizes the error */
val
=
(
FT_Fixed
)(
(
(
FT_Int64
)
val
*
FT_TRIG_SCALE
+
0x40000000UL
)
>>
32
);
val
=
(
FT_Fixed
)(
(
(
FT_Int64
)
val
*
FT_TRIG_SCALE
+
0x40000000UL
)
>>
32
);
return
(
s
>=
0
)
?
val
:
-
val
;
return
s
<
0
?
-
val
:
val
;
}
}
#else
/* !FT_LONG64 */
#else
/* !FT_LONG64 */
...
@@ -117,12 +117,12 @@
...
@@ -117,12 +117,12 @@
/* and CORDIC hypotenuse, so it minimizes the error */
/* and CORDIC hypotenuse, so it minimizes the error */
/* Check carry overflow of lo + 0x40000000 */
/* Check carry overflow of lo + 0x40000000 */
lo
+=
0x40000000U
;
lo
+=
0x40000000U
L
;
hi
+=
(
lo
<
0x40000000U
);
hi
+=
(
lo
<
0x40000000U
L
);
val
=
(
FT_Fixed
)
hi
;
val
=
(
FT_Fixed
)
hi
;
return
(
s
>=
0
)
?
val
:
-
val
;
return
s
<
0
?
-
val
:
val
;
}
}
#endif
/* !FT_LONG64 */
#endif
/* !FT_LONG64 */
...
@@ -480,8 +480,8 @@
...
@@ -480,8 +480,8 @@
v
.
x
=
ft_trig_downscale
(
v
.
x
);
v
.
x
=
ft_trig_downscale
(
v
.
x
);
*
length
=
(
shift
>=
0
)
?
(
v
.
x
>>
shift
)
*
length
=
shift
>=
0
?
(
v
.
x
>>
shift
)
:
(
FT_Fixed
)(
(
FT_UInt32
)
v
.
x
<<
-
shift
);
:
(
FT_Fixed
)(
(
FT_UInt32
)
v
.
x
<<
-
shift
);
*
angle
=
v
.
y
;
*
angle
=
v
.
y
;
}
}
...
...
components/external/freetype/src/bdf/bdflib.c
浏览文件 @
2fc33973
...
@@ -781,8 +781,8 @@
...
@@ -781,8 +781,8 @@
hold
=
buf
[
end
];
hold
=
buf
[
end
];
buf
[
end
]
=
0
;
buf
[
end
]
=
0
;
/* XXX: Use encoding independent value for 0x1
a
*/
/* XXX: Use encoding independent value for 0x1
A
*/
if
(
buf
[
start
]
!=
'#'
&&
buf
[
start
]
!=
0x1
a
&&
end
>
start
)
if
(
buf
[
start
]
!=
'#'
&&
buf
[
start
]
!=
0x1
A
&&
end
>
start
)
{
{
error
=
(
*
cb
)(
buf
+
start
,
(
unsigned
long
)(
end
-
start
),
lineno
,
error
=
(
*
cb
)(
buf
+
start
,
(
unsigned
long
)(
end
-
start
),
lineno
,
(
void
*
)
&
cb
,
client_data
);
(
void
*
)
&
cb
,
client_data
);
...
@@ -823,17 +823,17 @@
...
@@ -823,17 +823,17 @@
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x01
,
0x02
,
0x03
,
0x04
,
0x05
,
0x06
,
0x07
,
0x08
,
0x09
,
0x00
,
0x00
,
0x00
,
0x01
,
0x02
,
0x03
,
0x04
,
0x05
,
0x06
,
0x07
,
0x08
,
0x09
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x0
a
,
0x0b
,
0x0c
,
0x0d
,
0x0e
,
0x0f
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x0
A
,
0x0B
,
0x0C
,
0x0D
,
0x0E
,
0x0F
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x0
a
,
0x0b
,
0x0c
,
0x0d
,
0x0e
,
0x0f
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x0
A
,
0x0B
,
0x0C
,
0x0D
,
0x0E
,
0x0F
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
};
};
static
const
unsigned
char
odigits
[
32
]
=
static
const
unsigned
char
odigits
[
32
]
=
{
{
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x
ff
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x
FF
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
...
@@ -841,7 +841,7 @@
...
@@ -841,7 +841,7 @@
static
const
unsigned
char
ddigits
[
32
]
=
static
const
unsigned
char
ddigits
[
32
]
=
{
{
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x
ff
,
0x03
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x
FF
,
0x03
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
...
@@ -849,8 +849,8 @@
...
@@ -849,8 +849,8 @@
static
const
unsigned
char
hdigits
[
32
]
=
static
const
unsigned
char
hdigits
[
32
]
=
{
{
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x
ff
,
0x03
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x
FF
,
0x03
,
0x7
e
,
0x00
,
0x00
,
0x00
,
0x7e
,
0x00
,
0x00
,
0x00
,
0x7
E
,
0x00
,
0x00
,
0x00
,
0x7E
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
};
};
...
...
components/external/freetype/src/bzip2/ftbzip2.c
浏览文件 @
2fc33973
...
@@ -131,7 +131,7 @@
...
@@ -131,7 +131,7 @@
/* head[0] && head[1] are the magic numbers; */
/* head[0] && head[1] are the magic numbers; */
/* head[2] is the version, and head[3] the blocksize */
/* head[2] is the version, and head[3] the blocksize */
if
(
head
[
0
]
!=
0x42
||
if
(
head
[
0
]
!=
0x42
||
head
[
1
]
!=
0x5
a
||
head
[
1
]
!=
0x5
A
||
head
[
2
]
!=
0x68
)
/* only support bzip2 (huffman) */
head
[
2
]
!=
0x68
)
/* only support bzip2 (huffman) */
{
{
error
=
FT_THROW
(
Invalid_File_Format
);
error
=
FT_THROW
(
Invalid_File_Format
);
...
...
components/external/freetype/src/cff/cf2font.c
浏览文件 @
2fc33973
...
@@ -150,8 +150,8 @@
...
@@ -150,8 +150,8 @@
/* logarithms; remembering that the 16 lowest bits of the fraction */
/* logarithms; remembering that the 16 lowest bits of the fraction */
/* are dropped this is correct to within a factor of almost 4. */
/* are dropped this is correct to within a factor of almost 4. */
/* For example, 0x80.0000 * 0x80.0000 = 0x4000.0000 is 23+23 and */
/* For example, 0x80.0000 * 0x80.0000 = 0x4000.0000 is 23+23 and */
/* is flagged as possible overflow because 0x
ff.ffff * 0xff.ffff
= */
/* is flagged as possible overflow because 0x
FF.FFFF * 0xFF.FFFF
= */
/* 0x
ffff.fe
00 is also 23+23. */
/* 0x
FFFF.FE
00 is also 23+23. */
logBase2
=
FT_MSB
(
(
FT_UInt32
)
stemWidthPer1000
)
+
logBase2
=
FT_MSB
(
(
FT_UInt32
)
stemWidthPer1000
)
+
FT_MSB
(
(
FT_UInt32
)
ppem
);
FT_MSB
(
(
FT_UInt32
)
ppem
);
...
...
components/external/freetype/src/cff/cffdrivr.c
浏览文件 @
2fc33973
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
/* */
/* */
/* OpenType font driver implementation (body). */
/* OpenType font driver implementation (body). */
/* */
/* */
/* Copyright 1996-201
3
by */
/* Copyright 1996-201
4
by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* This file is part of the FreeType project, and may only be used, */
...
@@ -753,7 +753,7 @@
...
@@ -753,7 +753,7 @@
FT_Module_Interface
result
;
FT_Module_Interface
result
;
/* CFF_SERVICES_GET derefers `library' in PIC mode */
/* CFF_SERVICES_GET derefer
ence
s `library' in PIC mode */
#ifdef FT_CONFIG_OPTION_PIC
#ifdef FT_CONFIG_OPTION_PIC
if
(
!
driver
)
if
(
!
driver
)
return
NULL
;
return
NULL
;
...
...
components/external/freetype/src/cff/cffparse.c
浏览文件 @
2fc33973
...
@@ -188,7 +188,7 @@
...
@@ -188,7 +188,7 @@
}
}
/* Read fraction part, if any. */
/* Read fraction part, if any. */
if
(
nib
==
0x
a
)
if
(
nib
==
0x
A
)
for
(;;)
for
(;;)
{
{
/* If we entered this iteration with phase == 4, we need */
/* If we entered this iteration with phase == 4, we need */
...
...
components/external/freetype/src/gxvalid/gxvbsln.c
浏览文件 @
2fc33973
...
@@ -72,10 +72,10 @@
...
@@ -72,10 +72,10 @@
static
void
static
void
gxv_bsln_LookupValue_validate
(
FT_UShort
glyph
,
gxv_bsln_LookupValue_validate
(
FT_UShort
glyph
,
GXV_LookupValueCPtr
value_p
,
GXV_LookupValueCPtr
value_p
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_UShort
v
=
value_p
->
u
;
FT_UShort
v
=
value_p
->
u
;
FT_UShort
*
ctlPoints
;
FT_UShort
*
ctlPoints
;
FT_UNUSED
(
glyph
);
FT_UNUSED
(
glyph
);
...
@@ -124,7 +124,7 @@
...
@@ -124,7 +124,7 @@
gxv_bsln_LookupFmt4_transit
(
FT_UShort
relative_gindex
,
gxv_bsln_LookupFmt4_transit
(
FT_UShort
relative_gindex
,
GXV_LookupValueCPtr
base_value_p
,
GXV_LookupValueCPtr
base_value_p
,
FT_Bytes
lookuptbl_limit
,
FT_Bytes
lookuptbl_limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
;
FT_Bytes
p
;
FT_Bytes
limit
;
FT_Bytes
limit
;
...
@@ -135,7 +135,7 @@
...
@@ -135,7 +135,7 @@
offset
=
(
FT_UShort
)(
base_value_p
->
u
+
offset
=
(
FT_UShort
)(
base_value_p
->
u
+
(
relative_gindex
*
sizeof
(
FT_UShort
)
)
);
(
relative_gindex
*
sizeof
(
FT_UShort
)
)
);
p
=
valid
->
lookuptbl_head
+
offset
;
p
=
gx
valid
->
lookuptbl_head
+
offset
;
limit
=
lookuptbl_limit
;
limit
=
lookuptbl_limit
;
GXV_LIMIT_CHECK
(
2
);
GXV_LIMIT_CHECK
(
2
);
...
@@ -148,7 +148,7 @@
...
@@ -148,7 +148,7 @@
static
void
static
void
gxv_bsln_parts_fmt0_validate
(
FT_Bytes
tables
,
gxv_bsln_parts_fmt0_validate
(
FT_Bytes
tables
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
tables
;
FT_Bytes
p
=
tables
;
...
@@ -158,7 +158,7 @@
...
@@ -158,7 +158,7 @@
/* deltas */
/* deltas */
GXV_LIMIT_CHECK
(
2
*
GXV_BSLN_VALUE_COUNT
);
GXV_LIMIT_CHECK
(
2
*
GXV_BSLN_VALUE_COUNT
);
valid
->
table_data
=
NULL
;
/* No ctlPoints here. */
gx
valid
->
table_data
=
NULL
;
/* No ctlPoints here. */
GXV_EXIT
;
GXV_EXIT
;
}
}
...
@@ -167,7 +167,7 @@
...
@@ -167,7 +167,7 @@
static
void
static
void
gxv_bsln_parts_fmt1_validate
(
FT_Bytes
tables
,
gxv_bsln_parts_fmt1_validate
(
FT_Bytes
tables
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
tables
;
FT_Bytes
p
=
tables
;
...
@@ -175,15 +175,15 @@
...
@@ -175,15 +175,15 @@
GXV_NAME_ENTER
(
"parts format 1"
);
GXV_NAME_ENTER
(
"parts format 1"
);
/* deltas */
/* deltas */
gxv_bsln_parts_fmt0_validate
(
p
,
limit
,
valid
);
gxv_bsln_parts_fmt0_validate
(
p
,
limit
,
gx
valid
);
/* mappingData */
/* mappingData */
valid
->
lookupval_sign
=
GXV_LOOKUPVALUE_UNSIGNED
;
gx
valid
->
lookupval_sign
=
GXV_LOOKUPVALUE_UNSIGNED
;
valid
->
lookupval_func
=
gxv_bsln_LookupValue_validate
;
gx
valid
->
lookupval_func
=
gxv_bsln_LookupValue_validate
;
valid
->
lookupfmt4_trans
=
gxv_bsln_LookupFmt4_transit
;
gx
valid
->
lookupfmt4_trans
=
gxv_bsln_LookupFmt4_transit
;
gxv_LookupTable_validate
(
p
+
2
*
GXV_BSLN_VALUE_COUNT
,
gxv_LookupTable_validate
(
p
+
2
*
GXV_BSLN_VALUE_COUNT
,
limit
,
limit
,
valid
);
gx
valid
);
GXV_EXIT
;
GXV_EXIT
;
}
}
...
@@ -192,7 +192,7 @@
...
@@ -192,7 +192,7 @@
static
void
static
void
gxv_bsln_parts_fmt2_validate
(
FT_Bytes
tables
,
gxv_bsln_parts_fmt2_validate
(
FT_Bytes
tables
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
tables
;
FT_Bytes
p
=
tables
;
...
@@ -211,7 +211,7 @@
...
@@ -211,7 +211,7 @@
stdGlyph
=
FT_NEXT_USHORT
(
p
);
stdGlyph
=
FT_NEXT_USHORT
(
p
);
GXV_TRACE
((
" (stdGlyph = %u)
\n
"
,
stdGlyph
));
GXV_TRACE
((
" (stdGlyph = %u)
\n
"
,
stdGlyph
));
gxv_glyphid_validate
(
stdGlyph
,
valid
);
gxv_glyphid_validate
(
stdGlyph
,
gx
valid
);
/* Record the position of ctlPoints */
/* Record the position of ctlPoints */
GXV_BSLN_DATA
(
ctlPoints_p
)
=
p
;
GXV_BSLN_DATA
(
ctlPoints_p
)
=
p
;
...
@@ -226,7 +226,7 @@
...
@@ -226,7 +226,7 @@
FT_INVALID_DATA
;
FT_INVALID_DATA
;
}
}
else
else
gxv_ctlPoint_validate
(
stdGlyph
,
(
FT_Short
)
ctlPoint
,
valid
);
gxv_ctlPoint_validate
(
stdGlyph
,
(
FT_Short
)
ctlPoint
,
gx
valid
);
}
}
GXV_EXIT
;
GXV_EXIT
;
...
@@ -236,7 +236,7 @@
...
@@ -236,7 +236,7 @@
static
void
static
void
gxv_bsln_parts_fmt3_validate
(
FT_Bytes
tables
,
gxv_bsln_parts_fmt3_validate
(
FT_Bytes
tables
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
tables
;
FT_Bytes
p
=
tables
;
...
@@ -244,15 +244,15 @@
...
@@ -244,15 +244,15 @@
GXV_NAME_ENTER
(
"parts format 3"
);
GXV_NAME_ENTER
(
"parts format 3"
);
/* stdGlyph + ctlPoints */
/* stdGlyph + ctlPoints */
gxv_bsln_parts_fmt2_validate
(
p
,
limit
,
valid
);
gxv_bsln_parts_fmt2_validate
(
p
,
limit
,
gx
valid
);
/* mappingData */
/* mappingData */
valid
->
lookupval_sign
=
GXV_LOOKUPVALUE_UNSIGNED
;
gx
valid
->
lookupval_sign
=
GXV_LOOKUPVALUE_UNSIGNED
;
valid
->
lookupval_func
=
gxv_bsln_LookupValue_validate
;
gx
valid
->
lookupval_func
=
gxv_bsln_LookupValue_validate
;
valid
->
lookupfmt4_trans
=
gxv_bsln_LookupFmt4_transit
;
gx
valid
->
lookupfmt4_trans
=
gxv_bsln_LookupFmt4_transit
;
gxv_LookupTable_validate
(
p
+
(
2
+
2
*
GXV_BSLN_VALUE_COUNT
),
gxv_LookupTable_validate
(
p
+
(
2
+
2
*
GXV_BSLN_VALUE_COUNT
),
limit
,
limit
,
valid
);
gx
valid
);
GXV_EXIT
;
GXV_EXIT
;
}
}
...
@@ -271,8 +271,8 @@
...
@@ -271,8 +271,8 @@
FT_Face
face
,
FT_Face
face
,
FT_Validator
ftvalid
)
FT_Validator
ftvalid
)
{
{
GXV_ValidatorRec
validrec
;
GXV_ValidatorRec
gx
validrec
;
GXV_Validator
valid
=
&
validrec
;
GXV_Validator
gxvalid
=
&
gx
validrec
;
GXV_bsln_DataRec
bslnrec
;
GXV_bsln_DataRec
bslnrec
;
GXV_bsln_Data
bsln
=
&
bslnrec
;
GXV_bsln_Data
bsln
=
&
bslnrec
;
...
@@ -293,9 +293,9 @@
...
@@ -293,9 +293,9 @@
};
};
valid
->
root
=
ftvalid
;
gx
valid
->
root
=
ftvalid
;
valid
->
table_data
=
bsln
;
gx
valid
->
table_data
=
bsln
;
valid
->
face
=
face
;
gx
valid
->
face
=
face
;
FT_TRACE3
((
"validating `bsln' table
\n
"
));
FT_TRACE3
((
"validating `bsln' table
\n
"
));
GXV_INIT
;
GXV_INIT
;
...
@@ -320,7 +320,7 @@
...
@@ -320,7 +320,7 @@
bsln
->
defaultBaseline
=
defaultBaseline
;
bsln
->
defaultBaseline
=
defaultBaseline
;
fmt_funcs_table
[
format
](
p
,
limit
,
valid
);
fmt_funcs_table
[
format
](
p
,
limit
,
gx
valid
);
FT_TRACE4
((
"
\n
"
));
FT_TRACE4
((
"
\n
"
));
}
}
...
...
components/external/freetype/src/gxvalid/gxvcommn.c
浏览文件 @
2fc33973
此差异已折叠。
点击以展开。
components/external/freetype/src/gxvalid/gxvcommn.h
浏览文件 @
2fc33973
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
/* */
/* */
/* TrueTypeGX/AAT common tables validation (specification). */
/* TrueTypeGX/AAT common tables validation (specification). */
/* */
/* */
/* Copyright 2004, 2005, 2012
*/
/* Copyright 2004, 2005, 2012
, 2014
*/
/* by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* */
...
@@ -62,7 +62,7 @@ FT_BEGIN_HEADER
...
@@ -62,7 +62,7 @@ FT_BEGIN_HEADER
#undef GXV_LOAD_UNUSED_VARS
/* debug purpose */
#undef GXV_LOAD_UNUSED_VARS
/* debug purpose */
#define IS_PARANOID_VALIDATION ( valid->root->level >= FT_VALIDATE_PARANOID )
#define IS_PARANOID_VALIDATION (
gx
valid->root->level >= FT_VALIDATE_PARANOID )
#define GXV_SET_ERR_IF_PARANOID( err ) { if ( IS_PARANOID_VALIDATION ) ( err ); }
#define GXV_SET_ERR_IF_PARANOID( err ) { if ( IS_PARANOID_VALIDATION ) ( err ); }
/*************************************************************************/
/*************************************************************************/
...
@@ -81,7 +81,7 @@ FT_BEGIN_HEADER
...
@@ -81,7 +81,7 @@ FT_BEGIN_HEADER
typedef
void
typedef
void
(
*
GXV_Validate_Func
)(
FT_Bytes
table
,
(
*
GXV_Validate_Func
)(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
);
GXV_Validator
gx
valid
);
/* ====================== LookupTable Validator ======================== */
/* ====================== LookupTable Validator ======================== */
...
@@ -106,13 +106,13 @@ FT_BEGIN_HEADER
...
@@ -106,13 +106,13 @@ FT_BEGIN_HEADER
typedef
void
typedef
void
(
*
GXV_Lookup_Value_Validate_Func
)(
FT_UShort
glyph
,
(
*
GXV_Lookup_Value_Validate_Func
)(
FT_UShort
glyph
,
GXV_LookupValueCPtr
value_p
,
GXV_LookupValueCPtr
value_p
,
GXV_Validator
valid
);
GXV_Validator
gx
valid
);
typedef
GXV_LookupValueDesc
typedef
GXV_LookupValueDesc
(
*
GXV_Lookup_Fmt4_Transit_Func
)(
FT_UShort
relative_gindex
,
(
*
GXV_Lookup_Fmt4_Transit_Func
)(
FT_UShort
relative_gindex
,
GXV_LookupValueCPtr
base_value_p
,
GXV_LookupValueCPtr
base_value_p
,
FT_Bytes
lookuptbl_limit
,
FT_Bytes
lookuptbl_limit
,
GXV_Validator
valid
);
GXV_Validator
gx
valid
);
/* ====================== StateTable Validator ========================= */
/* ====================== StateTable Validator ========================= */
...
@@ -131,10 +131,10 @@ FT_BEGIN_HEADER
...
@@ -131,10 +131,10 @@ FT_BEGIN_HEADER
#define GXV_GLYPHOFFSET_FMT( table ) \
#define GXV_GLYPHOFFSET_FMT( table ) \
( valid->table.entry_glyphoffset_fmt )
(
gx
valid->table.entry_glyphoffset_fmt )
#define GXV_GLYPHOFFSET_SIZE( table ) \
#define GXV_GLYPHOFFSET_SIZE( table ) \
( valid->table.entry_glyphoffset_fmt / 2 )
(
gx
valid->table.entry_glyphoffset_fmt / 2 )
/* ----------------------- 16bit StateTable ---------------------------- */
/* ----------------------- 16bit StateTable ---------------------------- */
...
@@ -160,7 +160,7 @@ FT_BEGIN_HEADER
...
@@ -160,7 +160,7 @@ FT_BEGIN_HEADER
FT_UShort
*
classTable_length_p
,
FT_UShort
*
classTable_length_p
,
FT_UShort
*
stateArray_length_p
,
FT_UShort
*
stateArray_length_p
,
FT_UShort
*
entryTable_length_p
,
FT_UShort
*
entryTable_length_p
,
GXV_Validator
valid
);
GXV_Validator
gx
valid
);
typedef
void
typedef
void
(
*
GXV_StateTable_Entry_Validate_Func
)(
(
*
GXV_StateTable_Entry_Validate_Func
)(
...
@@ -169,12 +169,12 @@ FT_BEGIN_HEADER
...
@@ -169,12 +169,12 @@ FT_BEGIN_HEADER
GXV_StateTable_GlyphOffsetCPtr
glyphOffset_p
,
GXV_StateTable_GlyphOffsetCPtr
glyphOffset_p
,
FT_Bytes
statetable_table
,
FT_Bytes
statetable_table
,
FT_Bytes
statetable_limit
,
FT_Bytes
statetable_limit
,
GXV_Validator
valid
);
GXV_Validator
gx
valid
);
typedef
void
typedef
void
(
*
GXV_StateTable_OptData_Load_Func
)(
FT_Bytes
table
,
(
*
GXV_StateTable_OptData_Load_Func
)(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
);
GXV_Validator
gx
valid
);
typedef
struct
GXV_StateTable_ValidatorRec_
typedef
struct
GXV_StateTable_ValidatorRec_
{
{
...
@@ -202,7 +202,7 @@ FT_BEGIN_HEADER
...
@@ -202,7 +202,7 @@ FT_BEGIN_HEADER
FT_ULong
*
classTable_length_p
,
FT_ULong
*
classTable_length_p
,
FT_ULong
*
stateArray_length_p
,
FT_ULong
*
stateArray_length_p
,
FT_ULong
*
entryTable_length_p
,
FT_ULong
*
entryTable_length_p
,
GXV_Validator
valid
);
GXV_Validator
gx
valid
);
typedef
void
typedef
void
(
*
GXV_XStateTable_Entry_Validate_Func
)(
(
*
GXV_XStateTable_Entry_Validate_Func
)(
...
@@ -211,7 +211,7 @@ FT_BEGIN_HEADER
...
@@ -211,7 +211,7 @@ FT_BEGIN_HEADER
GXV_StateTable_GlyphOffsetCPtr
glyphOffset_p
,
GXV_StateTable_GlyphOffsetCPtr
glyphOffset_p
,
FT_Bytes
xstatetable_table
,
FT_Bytes
xstatetable_table
,
FT_Bytes
xstatetable_limit
,
FT_Bytes
xstatetable_limit
,
GXV_Validator
valid
);
GXV_Validator
gx
valid
);
typedef
GXV_StateTable_OptData_Load_Func
GXV_XStateTable_OptData_Load_Func
;
typedef
GXV_StateTable_OptData_Load_Func
GXV_XStateTable_OptData_Load_Func
;
...
@@ -263,35 +263,35 @@ FT_BEGIN_HEADER
...
@@ -263,35 +263,35 @@ FT_BEGIN_HEADER
#define GXV_TABLE_DATA( tag, field ) \
#define GXV_TABLE_DATA( tag, field ) \
( ( (GXV_ ## tag ## _Data)valid->table_data )->field )
( ( (GXV_ ## tag ## _Data)
gx
valid->table_data )->field )
#undef FT_INVALID_
#undef FT_INVALID_
#define FT_INVALID_( _
prefix, _error )
\
#define FT_INVALID_( _
error )
\
ft_validator_error(
valid->root, _prefix ## _error
)
ft_validator_error(
gxvalid->root, FT_THROW( _error )
)
#define GXV_LIMIT_CHECK( _count ) \
#define GXV_LIMIT_CHECK( _count ) \
FT_BEGIN_STMNT \
FT_BEGIN_STMNT \
if ( p + _count > ( limit? limit : valid->root->limit ) ) \
if ( p + _count > ( limit? limit :
gx
valid->root->limit ) ) \
FT_INVALID_TOO_SHORT; \
FT_INVALID_TOO_SHORT; \
FT_END_STMNT
FT_END_STMNT
#ifdef FT_DEBUG_LEVEL_TRACE
#ifdef FT_DEBUG_LEVEL_TRACE
#define GXV_INIT valid->debug_indent = 0
#define GXV_INIT
gx
valid->debug_indent = 0
#define GXV_NAME_ENTER( name ) \
#define GXV_NAME_ENTER( name ) \
FT_BEGIN_STMNT \
FT_BEGIN_STMNT \
valid->debug_indent += 2; \
gx
valid->debug_indent += 2; \
FT_TRACE4(( "%*.s", valid->debug_indent, 0 )); \
FT_TRACE4(( "%*.s",
gx
valid->debug_indent, 0 )); \
FT_TRACE4(( "%s table\n", name )); \
FT_TRACE4(( "%s table\n", name )); \
FT_END_STMNT
FT_END_STMNT
#define GXV_EXIT valid->debug_indent -= 2
#define GXV_EXIT
gx
valid->debug_indent -= 2
#define GXV_TRACE( s ) \
#define GXV_TRACE( s ) \
FT_BEGIN_STMNT \
FT_BEGIN_STMNT \
FT_TRACE4(( "%*.s", valid->debug_indent, 0 )); \
FT_TRACE4(( "%*.s",
gx
valid->debug_indent, 0 )); \
FT_TRACE4( s ); \
FT_TRACE4( s ); \
FT_END_STMNT
FT_END_STMNT
...
@@ -349,7 +349,7 @@ FT_BEGIN_HEADER
...
@@ -349,7 +349,7 @@ FT_BEGIN_HEADER
\
\
\
\
for ( b = p; b < (FT_Bytes)p + len; b++ ) \
for ( b = p; b < (FT_Bytes)p + len; b++ ) \
if ( 0x40 < *b && *b < 0x7
e
) \
if ( 0x40 < *b && *b < 0x7
E
) \
FT_TRACE1(("%c", *b)) ; \
FT_TRACE1(("%c", *b)) ; \
else \
else \
FT_TRACE1(("\\x%02x", *b)) ; \
FT_TRACE1(("\\x%02x", *b)) ; \
...
@@ -373,12 +373,12 @@ FT_BEGIN_HEADER
...
@@ -373,12 +373,12 @@ FT_BEGIN_HEADER
FT_Bytes
limit
,
FT_Bytes
limit
,
FT_UShort
*
unitSize_p
,
FT_UShort
*
unitSize_p
,
FT_UShort
*
nUnits_p
,
FT_UShort
*
nUnits_p
,
GXV_Validator
valid
);
GXV_Validator
gx
valid
);
FT_LOCAL
(
void
)
FT_LOCAL
(
void
)
gxv_LookupTable_validate
(
FT_Bytes
table
,
gxv_LookupTable_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
);
GXV_Validator
gx
valid
);
/*************************************************************************/
/*************************************************************************/
...
@@ -391,7 +391,7 @@ FT_BEGIN_HEADER
...
@@ -391,7 +391,7 @@ FT_BEGIN_HEADER
FT_LOCAL
(
FT_Int
)
FT_LOCAL
(
FT_Int
)
gxv_glyphid_validate
(
FT_UShort
gid
,
gxv_glyphid_validate
(
FT_UShort
gid
,
GXV_Validator
valid
);
GXV_Validator
gx
valid
);
/*************************************************************************/
/*************************************************************************/
...
@@ -405,7 +405,7 @@ FT_BEGIN_HEADER
...
@@ -405,7 +405,7 @@ FT_BEGIN_HEADER
FT_LOCAL
(
void
)
FT_LOCAL
(
void
)
gxv_ctlPoint_validate
(
FT_UShort
gid
,
gxv_ctlPoint_validate
(
FT_UShort
gid
,
FT_Short
ctl_point
,
FT_Short
ctl_point
,
GXV_Validator
valid
);
GXV_Validator
gx
valid
);
/*************************************************************************/
/*************************************************************************/
...
@@ -420,7 +420,7 @@ FT_BEGIN_HEADER
...
@@ -420,7 +420,7 @@ FT_BEGIN_HEADER
gxv_sfntName_validate
(
FT_UShort
name_index
,
gxv_sfntName_validate
(
FT_UShort
name_index
,
FT_UShort
min_index
,
FT_UShort
min_index
,
FT_UShort
max_index
,
FT_UShort
max_index
,
GXV_Validator
valid
);
GXV_Validator
gx
valid
);
/*************************************************************************/
/*************************************************************************/
...
@@ -439,7 +439,7 @@ FT_BEGIN_HEADER
...
@@ -439,7 +439,7 @@ FT_BEGIN_HEADER
FT_UShort
*
classTable_length_p
,
FT_UShort
*
classTable_length_p
,
FT_UShort
*
stateArray_length_p
,
FT_UShort
*
stateArray_length_p
,
FT_UShort
*
entryTable_length_p
,
FT_UShort
*
entryTable_length_p
,
GXV_Validator
valid
);
GXV_Validator
gx
valid
);
FT_LOCAL
(
void
)
FT_LOCAL
(
void
)
gxv_XStateTable_subtable_setup
(
FT_ULong
table_size
,
gxv_XStateTable_subtable_setup
(
FT_ULong
table_size
,
...
@@ -449,17 +449,17 @@ FT_BEGIN_HEADER
...
@@ -449,17 +449,17 @@ FT_BEGIN_HEADER
FT_ULong
*
classTable_length_p
,
FT_ULong
*
classTable_length_p
,
FT_ULong
*
stateArray_length_p
,
FT_ULong
*
stateArray_length_p
,
FT_ULong
*
entryTable_length_p
,
FT_ULong
*
entryTable_length_p
,
GXV_Validator
valid
);
GXV_Validator
gx
valid
);
FT_LOCAL
(
void
)
FT_LOCAL
(
void
)
gxv_StateTable_validate
(
FT_Bytes
table
,
gxv_StateTable_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
);
GXV_Validator
gx
valid
);
FT_LOCAL
(
void
)
FT_LOCAL
(
void
)
gxv_XStateTable_validate
(
FT_Bytes
table
,
gxv_XStateTable_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
);
GXV_Validator
gx
valid
);
/*************************************************************************/
/*************************************************************************/
...
@@ -475,14 +475,14 @@ FT_BEGIN_HEADER
...
@@ -475,14 +475,14 @@ FT_BEGIN_HEADER
FT_Bytes
limit
,
FT_Bytes
limit
,
FT_Byte
*
min
,
FT_Byte
*
min
,
FT_Byte
*
max
,
FT_Byte
*
max
,
GXV_Validator
valid
);
GXV_Validator
gx
valid
);
FT_LOCAL
(
void
)
FT_LOCAL
(
void
)
gxv_array_getlimits_ushort
(
FT_Bytes
table
,
gxv_array_getlimits_ushort
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
FT_UShort
*
min
,
FT_UShort
*
min
,
FT_UShort
*
max
,
FT_UShort
*
max
,
GXV_Validator
valid
);
GXV_Validator
gx
valid
);
FT_LOCAL
(
void
)
FT_LOCAL
(
void
)
gxv_set_length_by_ushort_offset
(
FT_UShort
*
offset
,
gxv_set_length_by_ushort_offset
(
FT_UShort
*
offset
,
...
@@ -490,7 +490,7 @@ FT_BEGIN_HEADER
...
@@ -490,7 +490,7 @@ FT_BEGIN_HEADER
FT_UShort
*
buff
,
FT_UShort
*
buff
,
FT_UInt
nmemb
,
FT_UInt
nmemb
,
FT_UShort
limit
,
FT_UShort
limit
,
GXV_Validator
valid
);
GXV_Validator
gx
valid
);
FT_LOCAL
(
void
)
FT_LOCAL
(
void
)
gxv_set_length_by_ulong_offset
(
FT_ULong
*
offset
,
gxv_set_length_by_ulong_offset
(
FT_ULong
*
offset
,
...
@@ -498,19 +498,19 @@ FT_BEGIN_HEADER
...
@@ -498,19 +498,19 @@ FT_BEGIN_HEADER
FT_ULong
*
buff
,
FT_ULong
*
buff
,
FT_UInt
nmemb
,
FT_UInt
nmemb
,
FT_ULong
limit
,
FT_ULong
limit
,
GXV_Validator
valid
);
GXV_Validator
gx
valid
);
#define GXV_SUBTABLE_OFFSET_CHECK( _offset ) \
#define GXV_SUBTABLE_OFFSET_CHECK( _offset ) \
FT_BEGIN_STMNT \
FT_BEGIN_STMNT \
if ( (_offset) > valid->subtable_length ) \
if ( (_offset) >
gx
valid->subtable_length ) \
FT_INVALID_OFFSET; \
FT_INVALID_OFFSET; \
FT_END_STMNT
FT_END_STMNT
#define GXV_SUBTABLE_LIMIT_CHECK( _count ) \
#define GXV_SUBTABLE_LIMIT_CHECK( _count ) \
FT_BEGIN_STMNT \
FT_BEGIN_STMNT \
if ( ( p + (_count) - valid->subtable_start ) > \
if ( ( p + (_count) -
gx
valid->subtable_start ) > \
valid->subtable_length ) \
gx
valid->subtable_length ) \
FT_INVALID_TOO_SHORT; \
FT_INVALID_TOO_SHORT; \
FT_END_STMNT
FT_END_STMNT
...
@@ -556,7 +556,7 @@ FT_BEGIN_HEADER
...
@@ -556,7 +556,7 @@ FT_BEGIN_HEADER
FT_LOCAL
(
void
)
FT_LOCAL
(
void
)
gxv_odtect_validate
(
GXV_odtect_Range
odtect
,
gxv_odtect_validate
(
GXV_odtect_Range
odtect
,
GXV_Validator
valid
);
GXV_Validator
gx
valid
);
#define GXV_ODTECT( n, odtect ) \
#define GXV_ODTECT( n, odtect ) \
...
...
components/external/freetype/src/gxvalid/gxvfeat.c
浏览文件 @
2fc33973
...
@@ -82,7 +82,7 @@
...
@@ -82,7 +82,7 @@
gxv_feat_registry_validate
(
FT_UShort
feature
,
gxv_feat_registry_validate
(
FT_UShort
feature
,
FT_UShort
nSettings
,
FT_UShort
nSettings
,
FT_Bool
exclusive
,
FT_Bool
exclusive
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
GXV_NAME_ENTER
(
"feature in registry"
);
GXV_NAME_ENTER
(
"feature in registry"
);
...
@@ -108,7 +108,7 @@
...
@@ -108,7 +108,7 @@
{
{
/* Don't use here. Apple is reserved. */
/* Don't use here. Apple is reserved. */
GXV_TRACE
((
"feature number %d is reserved by Apple
\n
"
,
feature
));
GXV_TRACE
((
"feature number %d is reserved by Apple
\n
"
,
feature
));
if
(
valid
->
root
->
level
>=
FT_VALIDATE_TIGHT
)
if
(
gx
valid
->
root
->
level
>=
FT_VALIDATE_TIGHT
)
FT_INVALID_DATA
;
FT_INVALID_DATA
;
}
}
...
@@ -117,7 +117,7 @@
...
@@ -117,7 +117,7 @@
GXV_TRACE
((
"feature %d: nSettings %d != defined nSettings %d
\n
"
,
GXV_TRACE
((
"feature %d: nSettings %d != defined nSettings %d
\n
"
,
feature
,
nSettings
,
feature
,
nSettings
,
gxv_feat_registry
[
feature
].
nSettings
));
gxv_feat_registry
[
feature
].
nSettings
));
if
(
valid
->
root
->
level
>=
FT_VALIDATE_TIGHT
)
if
(
gx
valid
->
root
->
level
>=
FT_VALIDATE_TIGHT
)
FT_INVALID_DATA
;
FT_INVALID_DATA
;
}
}
...
@@ -125,7 +125,7 @@
...
@@ -125,7 +125,7 @@
{
{
GXV_TRACE
((
"exclusive flag %d differs from predefined value
\n
"
,
GXV_TRACE
((
"exclusive flag %d differs from predefined value
\n
"
,
exclusive
));
exclusive
));
if
(
valid
->
root
->
level
>=
FT_VALIDATE_TIGHT
)
if
(
gx
valid
->
root
->
level
>=
FT_VALIDATE_TIGHT
)
FT_INVALID_DATA
;
FT_INVALID_DATA
;
}
}
...
@@ -137,7 +137,7 @@
...
@@ -137,7 +137,7 @@
static
void
static
void
gxv_feat_name_index_validate
(
FT_Bytes
table
,
gxv_feat_name_index_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
...
@@ -153,7 +153,7 @@
...
@@ -153,7 +153,7 @@
gxv_sfntName_validate
(
(
FT_UShort
)
nameIndex
,
gxv_sfntName_validate
(
(
FT_UShort
)
nameIndex
,
255
,
255
,
32768U
,
32768U
,
valid
);
gx
valid
);
GXV_EXIT
;
GXV_EXIT
;
}
}
...
@@ -163,7 +163,7 @@
...
@@ -163,7 +163,7 @@
gxv_feat_setting_validate
(
FT_Bytes
table
,
gxv_feat_setting_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
FT_Bool
exclusive
,
FT_Bool
exclusive
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
FT_UShort
setting
;
FT_UShort
setting
;
...
@@ -179,7 +179,7 @@
...
@@ -179,7 +179,7 @@
if
(
exclusive
&&
(
setting
&
1
)
==
0
)
if
(
exclusive
&&
(
setting
&
1
)
==
0
)
FT_INVALID_DATA
;
FT_INVALID_DATA
;
gxv_feat_name_index_validate
(
p
,
limit
,
valid
);
gxv_feat_name_index_validate
(
p
,
limit
,
gx
valid
);
GXV_FEAT_DATA
(
setting
)
=
setting
;
GXV_FEAT_DATA
(
setting
)
=
setting
;
...
@@ -190,7 +190,7 @@
...
@@ -190,7 +190,7 @@
static
void
static
void
gxv_feat_name_validate
(
FT_Bytes
table
,
gxv_feat_name_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
FT_UInt
reserved_size
=
GXV_FEAT_DATA
(
reserved_size
);
FT_UInt
reserved_size
=
GXV_FEAT_DATA
(
reserved_size
);
...
@@ -240,14 +240,14 @@
...
@@ -240,14 +240,14 @@
FT_INVALID_FORMAT
;
FT_INVALID_FORMAT
;
}
}
gxv_feat_registry_validate
(
feature
,
nSettings
,
exclusive
,
valid
);
gxv_feat_registry_validate
(
feature
,
nSettings
,
exclusive
,
gx
valid
);
gxv_feat_name_index_validate
(
p
,
limit
,
valid
);
gxv_feat_name_index_validate
(
p
,
limit
,
gx
valid
);
p
=
valid
->
root
->
base
+
settingTable
;
p
=
gx
valid
->
root
->
base
+
settingTable
;
for
(
last_setting
=
-
1
,
i
=
0
;
i
<
nSettings
;
i
++
)
for
(
last_setting
=
-
1
,
i
=
0
;
i
<
nSettings
;
i
++
)
{
{
gxv_feat_setting_validate
(
p
,
limit
,
exclusive
,
valid
);
gxv_feat_setting_validate
(
p
,
limit
,
exclusive
,
gx
valid
);
if
(
(
FT_Int
)
GXV_FEAT_DATA
(
setting
)
<=
last_setting
)
if
(
(
FT_Int
)
GXV_FEAT_DATA
(
setting
)
<=
last_setting
)
GXV_SET_ERR_IF_PARANOID
(
FT_INVALID_FORMAT
);
GXV_SET_ERR_IF_PARANOID
(
FT_INVALID_FORMAT
);
...
@@ -274,8 +274,8 @@
...
@@ -274,8 +274,8 @@
FT_Face
face
,
FT_Face
face
,
FT_Validator
ftvalid
)
FT_Validator
ftvalid
)
{
{
GXV_ValidatorRec
validrec
;
GXV_ValidatorRec
gx
validrec
;
GXV_Validator
valid
=
&
validrec
;
GXV_Validator
gxvalid
=
&
gx
validrec
;
GXV_feat_DataRec
featrec
;
GXV_feat_DataRec
featrec
;
GXV_feat_Data
feat
=
&
featrec
;
GXV_feat_Data
feat
=
&
featrec
;
...
@@ -289,9 +289,9 @@
...
@@ -289,9 +289,9 @@
FT_Int
last_feature
;
FT_Int
last_feature
;
valid
->
root
=
ftvalid
;
gx
valid
->
root
=
ftvalid
;
valid
->
table_data
=
feat
;
gx
valid
->
table_data
=
feat
;
valid
->
face
=
face
;
gx
valid
->
face
=
face
;
FT_TRACE3
((
"validating `feat' table
\n
"
));
FT_TRACE3
((
"validating `feat' table
\n
"
));
GXV_INIT
;
GXV_INIT
;
...
@@ -323,7 +323,7 @@
...
@@ -323,7 +323,7 @@
for
(
last_feature
=
-
1
,
i
=
0
;
i
<
featureNameCount
;
i
++
)
for
(
last_feature
=
-
1
,
i
=
0
;
i
<
featureNameCount
;
i
++
)
{
{
gxv_feat_name_validate
(
p
,
limit
,
valid
);
gxv_feat_name_validate
(
p
,
limit
,
gx
valid
);
if
(
(
FT_Int
)
GXV_FEAT_DATA
(
feature
)
<=
last_feature
)
if
(
(
FT_Int
)
GXV_FEAT_DATA
(
feature
)
<=
last_feature
)
GXV_SET_ERR_IF_PARANOID
(
FT_INVALID_FORMAT
);
GXV_SET_ERR_IF_PARANOID
(
FT_INVALID_FORMAT
);
...
...
components/external/freetype/src/gxvalid/gxvjust.c
浏览文件 @
2fc33973
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
/* */
/* */
/* TrueTypeGX/AAT just table validation (body). */
/* TrueTypeGX/AAT just table validation (body). */
/* */
/* */
/* Copyright 2005
by suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
*/
/* Copyright 2005
, 2014 by suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
*/
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* This file is part of the FreeType project, and may only be used, */
...
@@ -69,14 +69,14 @@
...
@@ -69,14 +69,14 @@
static
void
static
void
gxv_just_check_max_gid
(
FT_UShort
gid
,
gxv_just_check_max_gid
(
FT_UShort
gid
,
const
FT_String
*
msg_tag
,
const
FT_String
*
msg_tag
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
if
(
gid
<
valid
->
face
->
num_glyphs
)
if
(
gid
<
gx
valid
->
face
->
num_glyphs
)
return
;
return
;
GXV_TRACE
((
"just table includes too large %s"
GXV_TRACE
((
"just table includes too large %s"
" GID=%d > %d (in maxp)
\n
"
,
" GID=%d > %d (in maxp)
\n
"
,
msg_tag
,
gid
,
valid
->
face
->
num_glyphs
));
msg_tag
,
gid
,
gx
valid
->
face
->
num_glyphs
));
GXV_SET_ERR_IF_PARANOID
(
FT_INVALID_GLYPH_ID
);
GXV_SET_ERR_IF_PARANOID
(
FT_INVALID_GLYPH_ID
);
}
}
...
@@ -84,7 +84,7 @@
...
@@ -84,7 +84,7 @@
static
void
static
void
gxv_just_wdp_entry_validate
(
FT_Bytes
table
,
gxv_just_wdp_entry_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
FT_ULong
justClass
;
FT_ULong
justClass
;
...
@@ -112,7 +112,7 @@
...
@@ -112,7 +112,7 @@
#endif
#endif
/* According to Apple spec, only 7bits in justClass is used */
/* According to Apple spec, only 7bits in justClass is used */
if
(
(
justClass
&
0xFFFFFF80
)
!=
0
)
if
(
(
justClass
&
0xFFFFFF80
UL
)
!=
0
)
{
{
GXV_TRACE
((
"just table includes non-zero value"
GXV_TRACE
((
"just table includes non-zero value"
" in unused justClass higher bits"
" in unused justClass higher bits"
...
@@ -120,14 +120,14 @@
...
@@ -120,14 +120,14 @@
GXV_SET_ERR_IF_PARANOID
(
FT_INVALID_DATA
);
GXV_SET_ERR_IF_PARANOID
(
FT_INVALID_DATA
);
}
}
valid
->
subtable_length
=
p
-
table
;
gx
valid
->
subtable_length
=
p
-
table
;
}
}
static
void
static
void
gxv_just_wdc_entry_validate
(
FT_Bytes
table
,
gxv_just_wdc_entry_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
FT_ULong
count
,
i
;
FT_ULong
count
,
i
;
...
@@ -138,18 +138,18 @@
...
@@ -138,18 +138,18 @@
for
(
i
=
0
;
i
<
count
;
i
++
)
for
(
i
=
0
;
i
<
count
;
i
++
)
{
{
GXV_TRACE
((
"validating wdc pair %d/%d
\n
"
,
i
+
1
,
count
));
GXV_TRACE
((
"validating wdc pair %d/%d
\n
"
,
i
+
1
,
count
));
gxv_just_wdp_entry_validate
(
p
,
limit
,
valid
);
gxv_just_wdp_entry_validate
(
p
,
limit
,
gx
valid
);
p
+=
valid
->
subtable_length
;
p
+=
gx
valid
->
subtable_length
;
}
}
valid
->
subtable_length
=
p
-
table
;
gx
valid
->
subtable_length
=
p
-
table
;
}
}
static
void
static
void
gxv_just_widthDeltaClusters_validate
(
FT_Bytes
table
,
gxv_just_widthDeltaClusters_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
FT_Bytes
wdc_end
=
table
+
GXV_JUST_DATA
(
wdc_offset_max
);
FT_Bytes
wdc_end
=
table
+
GXV_JUST_DATA
(
wdc_offset_max
);
...
@@ -163,11 +163,11 @@
...
@@ -163,11 +163,11 @@
for
(
i
=
0
;
p
<=
wdc_end
;
i
++
)
for
(
i
=
0
;
p
<=
wdc_end
;
i
++
)
{
{
gxv_just_wdc_entry_validate
(
p
,
limit
,
valid
);
gxv_just_wdc_entry_validate
(
p
,
limit
,
gx
valid
);
p
+=
valid
->
subtable_length
;
p
+=
gx
valid
->
subtable_length
;
}
}
valid
->
subtable_length
=
p
-
table
;
gx
valid
->
subtable_length
=
p
-
table
;
GXV_EXIT
;
GXV_EXIT
;
}
}
...
@@ -176,7 +176,7 @@
...
@@ -176,7 +176,7 @@
static
void
static
void
gxv_just_actSubrecord_type0_validate
(
FT_Bytes
table
,
gxv_just_actSubrecord_type0_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
...
@@ -214,17 +214,17 @@
...
@@ -214,17 +214,17 @@
GXV_LIMIT_CHECK
(
2
);
GXV_LIMIT_CHECK
(
2
);
glyphs
=
FT_NEXT_USHORT
(
p
);
glyphs
=
FT_NEXT_USHORT
(
p
);
gxv_just_check_max_gid
(
glyphs
,
"type0:glyphs"
,
valid
);
gxv_just_check_max_gid
(
glyphs
,
"type0:glyphs"
,
gx
valid
);
}
}
valid
->
subtable_length
=
p
-
table
;
gx
valid
->
subtable_length
=
p
-
table
;
}
}
static
void
static
void
gxv_just_actSubrecord_type1_validate
(
FT_Bytes
table
,
gxv_just_actSubrecord_type1_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
FT_UShort
addGlyph
;
FT_UShort
addGlyph
;
...
@@ -233,20 +233,20 @@
...
@@ -233,20 +233,20 @@
GXV_LIMIT_CHECK
(
2
);
GXV_LIMIT_CHECK
(
2
);
addGlyph
=
FT_NEXT_USHORT
(
p
);
addGlyph
=
FT_NEXT_USHORT
(
p
);
gxv_just_check_max_gid
(
addGlyph
,
"type1:addGlyph"
,
valid
);
gxv_just_check_max_gid
(
addGlyph
,
"type1:addGlyph"
,
gx
valid
);
valid
->
subtable_length
=
p
-
table
;
gx
valid
->
subtable_length
=
p
-
table
;
}
}
static
void
static
void
gxv_just_actSubrecord_type2_validate
(
FT_Bytes
table
,
gxv_just_actSubrecord_type2_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
#ifdef GXV_LOAD_UNUSED_VARS
#ifdef GXV_LOAD_UNUSED_VARS
FT_Fixed
substThreshhold
;
/* Apple misspelled "Threshhold" */
FT_Fixed
substThreshhold
;
/* Apple misspelled "Threshhold" */
#endif
#endif
FT_UShort
addGlyph
;
FT_UShort
addGlyph
;
FT_UShort
substGlyph
;
FT_UShort
substGlyph
;
...
@@ -262,18 +262,18 @@
...
@@ -262,18 +262,18 @@
substGlyph
=
FT_NEXT_USHORT
(
p
);
substGlyph
=
FT_NEXT_USHORT
(
p
);
if
(
addGlyph
!=
0xFFFF
)
if
(
addGlyph
!=
0xFFFF
)
gxv_just_check_max_gid
(
addGlyph
,
"type2:addGlyph"
,
valid
);
gxv_just_check_max_gid
(
addGlyph
,
"type2:addGlyph"
,
gx
valid
);
gxv_just_check_max_gid
(
substGlyph
,
"type2:substGlyph"
,
valid
);
gxv_just_check_max_gid
(
substGlyph
,
"type2:substGlyph"
,
gx
valid
);
valid
->
subtable_length
=
p
-
table
;
gx
valid
->
subtable_length
=
p
-
table
;
}
}
static
void
static
void
gxv_just_actSubrecord_type4_validate
(
FT_Bytes
table
,
gxv_just_actSubrecord_type4_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
FT_ULong
variantsAxis
;
FT_ULong
variantsAxis
;
...
@@ -288,9 +288,9 @@
...
@@ -288,9 +288,9 @@
noStretchValue
=
FT_NEXT_ULONG
(
p
);
noStretchValue
=
FT_NEXT_ULONG
(
p
);
maximumLimit
=
FT_NEXT_ULONG
(
p
);
maximumLimit
=
FT_NEXT_ULONG
(
p
);
valid
->
subtable_length
=
p
-
table
;
gx
valid
->
subtable_length
=
p
-
table
;
if
(
variantsAxis
!=
0x64756374
)
/* 'duct' */
if
(
variantsAxis
!=
0x64756374
L
)
/* 'duct' */
GXV_TRACE
((
"variantsAxis 0x%08x is non default value"
,
GXV_TRACE
((
"variantsAxis 0x%08x is non default value"
,
variantsAxis
));
variantsAxis
));
...
@@ -310,7 +310,7 @@
...
@@ -310,7 +310,7 @@
static
void
static
void
gxv_just_actSubrecord_type5_validate
(
FT_Bytes
table
,
gxv_just_actSubrecord_type5_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
FT_UShort
flags
;
FT_UShort
flags
;
...
@@ -324,9 +324,9 @@
...
@@ -324,9 +324,9 @@
if
(
flags
)
if
(
flags
)
GXV_TRACE
((
"type5: nonzero value 0x%04x in unused flags
\n
"
,
GXV_TRACE
((
"type5: nonzero value 0x%04x in unused flags
\n
"
,
flags
));
flags
));
gxv_just_check_max_gid
(
glyph
,
"type5:glyph"
,
valid
);
gxv_just_check_max_gid
(
glyph
,
"type5:glyph"
,
gx
valid
);
valid
->
subtable_length
=
p
-
table
;
gx
valid
->
subtable_length
=
p
-
table
;
}
}
...
@@ -334,7 +334,7 @@
...
@@ -334,7 +334,7 @@
static
void
static
void
gxv_just_actSubrecord_validate
(
FT_Bytes
table
,
gxv_just_actSubrecord_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
FT_UShort
actionClass
;
FT_UShort
actionClass
;
...
@@ -354,21 +354,21 @@
...
@@ -354,21 +354,21 @@
GXV_SET_ERR_IF_PARANOID
(
FT_INVALID_DATA
);
GXV_SET_ERR_IF_PARANOID
(
FT_INVALID_DATA
);
if
(
actionType
==
0
)
if
(
actionType
==
0
)
gxv_just_actSubrecord_type0_validate
(
p
,
limit
,
valid
);
gxv_just_actSubrecord_type0_validate
(
p
,
limit
,
gx
valid
);
else
if
(
actionType
==
1
)
else
if
(
actionType
==
1
)
gxv_just_actSubrecord_type1_validate
(
p
,
limit
,
valid
);
gxv_just_actSubrecord_type1_validate
(
p
,
limit
,
gx
valid
);
else
if
(
actionType
==
2
)
else
if
(
actionType
==
2
)
gxv_just_actSubrecord_type2_validate
(
p
,
limit
,
valid
);
gxv_just_actSubrecord_type2_validate
(
p
,
limit
,
gx
valid
);
else
if
(
actionType
==
3
)
else
if
(
actionType
==
3
)
;
/* Stretch glyph action: no actionData */
;
/* Stretch glyph action: no actionData */
else
if
(
actionType
==
4
)
else
if
(
actionType
==
4
)
gxv_just_actSubrecord_type4_validate
(
p
,
limit
,
valid
);
gxv_just_actSubrecord_type4_validate
(
p
,
limit
,
gx
valid
);
else
if
(
actionType
==
5
)
else
if
(
actionType
==
5
)
gxv_just_actSubrecord_type5_validate
(
p
,
limit
,
valid
);
gxv_just_actSubrecord_type5_validate
(
p
,
limit
,
gx
valid
);
else
else
FT_INVALID_DATA
;
FT_INVALID_DATA
;
valid
->
subtable_length
=
actionLength
;
gx
valid
->
subtable_length
=
actionLength
;
GXV_EXIT
;
GXV_EXIT
;
}
}
...
@@ -377,7 +377,7 @@
...
@@ -377,7 +377,7 @@
static
void
static
void
gxv_just_pcActionRecord_validate
(
FT_Bytes
table
,
gxv_just_pcActionRecord_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
FT_ULong
actionCount
;
FT_ULong
actionCount
;
...
@@ -390,11 +390,11 @@
...
@@ -390,11 +390,11 @@
for
(
i
=
0
;
i
<
actionCount
;
i
++
)
for
(
i
=
0
;
i
<
actionCount
;
i
++
)
{
{
gxv_just_actSubrecord_validate
(
p
,
limit
,
valid
);
gxv_just_actSubrecord_validate
(
p
,
limit
,
gx
valid
);
p
+=
valid
->
subtable_length
;
p
+=
gx
valid
->
subtable_length
;
}
}
valid
->
subtable_length
=
p
-
table
;
gx
valid
->
subtable_length
=
p
-
table
;
GXV_EXIT
;
GXV_EXIT
;
}
}
...
@@ -403,7 +403,7 @@
...
@@ -403,7 +403,7 @@
static
void
static
void
gxv_just_pcTable_LookupValue_entry_validate
(
FT_UShort
glyph
,
gxv_just_pcTable_LookupValue_entry_validate
(
FT_UShort
glyph
,
GXV_LookupValueCPtr
value_p
,
GXV_LookupValueCPtr
value_p
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_UNUSED
(
glyph
);
FT_UNUSED
(
glyph
);
...
@@ -417,19 +417,19 @@
...
@@ -417,19 +417,19 @@
static
void
static
void
gxv_just_pcLookupTable_validate
(
FT_Bytes
table
,
gxv_just_pcLookupTable_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
GXV_NAME_ENTER
(
"just pcLookupTable"
);
GXV_NAME_ENTER
(
"just pcLookupTable"
);
GXV_JUST_DATA
(
pc_offset_max
)
=
0x0000
;
GXV_JUST_DATA
(
pc_offset_max
)
=
0x0000
;
GXV_JUST_DATA
(
pc_offset_min
)
=
0xFFFFU
;
GXV_JUST_DATA
(
pc_offset_min
)
=
0xFFFFU
;
valid
->
lookupval_sign
=
GXV_LOOKUPVALUE_UNSIGNED
;
gx
valid
->
lookupval_sign
=
GXV_LOOKUPVALUE_UNSIGNED
;
valid
->
lookupval_func
=
gxv_just_pcTable_LookupValue_entry_validate
;
gx
valid
->
lookupval_func
=
gxv_just_pcTable_LookupValue_entry_validate
;
gxv_LookupTable_validate
(
p
,
limit
,
valid
);
gxv_LookupTable_validate
(
p
,
limit
,
gx
valid
);
/* subtable_length is set by gxv_LookupTable_validate() */
/* subtable_length is set by gxv_LookupTable_validate() */
...
@@ -440,20 +440,20 @@
...
@@ -440,20 +440,20 @@
static
void
static
void
gxv_just_postcompTable_validate
(
FT_Bytes
table
,
gxv_just_postcompTable_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
GXV_NAME_ENTER
(
"just postcompTable"
);
GXV_NAME_ENTER
(
"just postcompTable"
);
gxv_just_pcLookupTable_validate
(
p
,
limit
,
valid
);
gxv_just_pcLookupTable_validate
(
p
,
limit
,
gx
valid
);
p
+=
valid
->
subtable_length
;
p
+=
gx
valid
->
subtable_length
;
gxv_just_pcActionRecord_validate
(
p
,
limit
,
valid
);
gxv_just_pcActionRecord_validate
(
p
,
limit
,
gx
valid
);
p
+=
valid
->
subtable_length
;
p
+=
gx
valid
->
subtable_length
;
valid
->
subtable_length
=
p
-
table
;
gx
valid
->
subtable_length
=
p
-
table
;
GXV_EXIT
;
GXV_EXIT
;
}
}
...
@@ -466,7 +466,7 @@
...
@@ -466,7 +466,7 @@
GXV_StateTable_GlyphOffsetCPtr
glyphOffset_p
,
GXV_StateTable_GlyphOffsetCPtr
glyphOffset_p
,
FT_Bytes
table
,
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
#ifdef GXV_LOAD_UNUSED_VARS
#ifdef GXV_LOAD_UNUSED_VARS
/* TODO: validate markClass & currentClass */
/* TODO: validate markClass & currentClass */
...
@@ -480,7 +480,7 @@
...
@@ -480,7 +480,7 @@
FT_UNUSED
(
glyphOffset_p
);
FT_UNUSED
(
glyphOffset_p
);
FT_UNUSED
(
table
);
FT_UNUSED
(
table
);
FT_UNUSED
(
limit
);
FT_UNUSED
(
limit
);
FT_UNUSED
(
valid
);
FT_UNUSED
(
gx
valid
);
#ifndef GXV_LOAD_UNUSED_VARS
#ifndef GXV_LOAD_UNUSED_VARS
FT_UNUSED
(
flags
);
FT_UNUSED
(
flags
);
...
@@ -496,7 +496,7 @@
...
@@ -496,7 +496,7 @@
static
void
static
void
gxv_just_justClassTable_validate
(
FT_Bytes
table
,
gxv_just_justClassTable_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
FT_UShort
length
;
FT_UShort
length
;
...
@@ -521,14 +521,14 @@
...
@@ -521,14 +521,14 @@
GXV_TRACE
((
" justClassTable: nonzero value (0x%08x)"
GXV_TRACE
((
" justClassTable: nonzero value (0x%08x)"
" in unused subFeatureFlags
\n
"
,
subFeatureFlags
));
" in unused subFeatureFlags
\n
"
,
subFeatureFlags
));
valid
->
statetable
.
optdata
=
NULL
;
gx
valid
->
statetable
.
optdata
=
NULL
;
valid
->
statetable
.
optdata_load_func
=
NULL
;
gx
valid
->
statetable
.
optdata_load_func
=
NULL
;
valid
->
statetable
.
subtable_setup_func
=
NULL
;
gx
valid
->
statetable
.
subtable_setup_func
=
NULL
;
valid
->
statetable
.
entry_glyphoffset_fmt
=
GXV_GLYPHOFFSET_NONE
;
gx
valid
->
statetable
.
entry_glyphoffset_fmt
=
GXV_GLYPHOFFSET_NONE
;
valid
->
statetable
.
entry_validate_func
=
gx
valid
->
statetable
.
entry_validate_func
=
gxv_just_classTable_entry_validate
;
gxv_just_classTable_entry_validate
;
gxv_StateTable_validate
(
p
,
table
+
length
,
valid
);
gxv_StateTable_validate
(
p
,
table
+
length
,
gx
valid
);
/* subtable_length is set by gxv_LookupTable_validate() */
/* subtable_length is set by gxv_LookupTable_validate() */
...
@@ -539,7 +539,7 @@
...
@@ -539,7 +539,7 @@
static
void
static
void
gxv_just_wdcTable_LookupValue_validate
(
FT_UShort
glyph
,
gxv_just_wdcTable_LookupValue_validate
(
FT_UShort
glyph
,
GXV_LookupValueCPtr
value_p
,
GXV_LookupValueCPtr
value_p
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_UNUSED
(
glyph
);
FT_UNUSED
(
glyph
);
...
@@ -553,7 +553,7 @@
...
@@ -553,7 +553,7 @@
static
void
static
void
gxv_just_justData_lookuptable_validate
(
FT_Bytes
table
,
gxv_just_justData_lookuptable_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
...
@@ -561,10 +561,10 @@
...
@@ -561,10 +561,10 @@
GXV_JUST_DATA
(
wdc_offset_max
)
=
0x0000
;
GXV_JUST_DATA
(
wdc_offset_max
)
=
0x0000
;
GXV_JUST_DATA
(
wdc_offset_min
)
=
0xFFFFU
;
GXV_JUST_DATA
(
wdc_offset_min
)
=
0xFFFFU
;
valid
->
lookupval_sign
=
GXV_LOOKUPVALUE_UNSIGNED
;
gx
valid
->
lookupval_sign
=
GXV_LOOKUPVALUE_UNSIGNED
;
valid
->
lookupval_func
=
gxv_just_wdcTable_LookupValue_validate
;
gx
valid
->
lookupval_func
=
gxv_just_wdcTable_LookupValue_validate
;
gxv_LookupTable_validate
(
p
,
limit
,
valid
);
gxv_LookupTable_validate
(
p
,
limit
,
gx
valid
);
/* subtable_length is set by gxv_LookupTable_validate() */
/* subtable_length is set by gxv_LookupTable_validate() */
...
@@ -578,7 +578,7 @@
...
@@ -578,7 +578,7 @@
static
void
static
void
gxv_just_justData_validate
(
FT_Bytes
table
,
gxv_just_justData_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
/*
/*
* following 3 offsets are measured from the start of `just'
* following 3 offsets are measured from the start of `just'
...
@@ -604,36 +604,36 @@
...
@@ -604,36 +604,36 @@
GXV_TRACE
((
" (wdcTableOffset = 0x%04x)
\n
"
,
wdcTableOffset
));
GXV_TRACE
((
" (wdcTableOffset = 0x%04x)
\n
"
,
wdcTableOffset
));
GXV_TRACE
((
" (pcTableOffset = 0x%04x)
\n
"
,
pcTableOffset
));
GXV_TRACE
((
" (pcTableOffset = 0x%04x)
\n
"
,
pcTableOffset
));
gxv_just_justData_lookuptable_validate
(
p
,
limit
,
valid
);
gxv_just_justData_lookuptable_validate
(
p
,
limit
,
gx
valid
);
gxv_odtect_add_range
(
p
,
valid
->
subtable_length
,
gxv_odtect_add_range
(
p
,
gx
valid
->
subtable_length
,
"just_LookupTable"
,
odtect
);
"just_LookupTable"
,
odtect
);
if
(
wdcTableOffset
)
if
(
wdcTableOffset
)
{
{
gxv_just_widthDeltaClusters_validate
(
gxv_just_widthDeltaClusters_validate
(
valid
->
root
->
base
+
wdcTableOffset
,
limit
,
valid
);
gxvalid
->
root
->
base
+
wdcTableOffset
,
limit
,
gx
valid
);
gxv_odtect_add_range
(
valid
->
root
->
base
+
wdcTableOffset
,
gxv_odtect_add_range
(
gx
valid
->
root
->
base
+
wdcTableOffset
,
valid
->
subtable_length
,
"just_wdcTable"
,
odtect
);
gx
valid
->
subtable_length
,
"just_wdcTable"
,
odtect
);
}
}
if
(
pcTableOffset
)
if
(
pcTableOffset
)
{
{
gxv_just_postcompTable_validate
(
valid
->
root
->
base
+
pcTableOffset
,
gxv_just_postcompTable_validate
(
gx
valid
->
root
->
base
+
pcTableOffset
,
limit
,
valid
);
limit
,
gx
valid
);
gxv_odtect_add_range
(
valid
->
root
->
base
+
pcTableOffset
,
gxv_odtect_add_range
(
gx
valid
->
root
->
base
+
pcTableOffset
,
valid
->
subtable_length
,
"just_pcTable"
,
odtect
);
gx
valid
->
subtable_length
,
"just_pcTable"
,
odtect
);
}
}
if
(
justClassTableOffset
)
if
(
justClassTableOffset
)
{
{
gxv_just_justClassTable_validate
(
gxv_just_justClassTable_validate
(
valid
->
root
->
base
+
justClassTableOffset
,
limit
,
valid
);
gxvalid
->
root
->
base
+
justClassTableOffset
,
limit
,
gx
valid
);
gxv_odtect_add_range
(
valid
->
root
->
base
+
justClassTableOffset
,
gxv_odtect_add_range
(
gx
valid
->
root
->
base
+
justClassTableOffset
,
valid
->
subtable_length
,
"just_justClassTable"
,
gx
valid
->
subtable_length
,
"just_justClassTable"
,
odtect
);
odtect
);
}
}
gxv_odtect_validate
(
odtect
,
valid
);
gxv_odtect_validate
(
odtect
,
gx
valid
);
GXV_EXIT
;
GXV_EXIT
;
}
}
...
@@ -647,8 +647,8 @@
...
@@ -647,8 +647,8 @@
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
FT_Bytes
limit
=
0
;
FT_Bytes
limit
=
0
;
GXV_ValidatorRec
validrec
;
GXV_ValidatorRec
gx
validrec
;
GXV_Validator
valid
=
&
validrec
;
GXV_Validator
gxvalid
=
&
gx
validrec
;
GXV_just_DataRec
justrec
;
GXV_just_DataRec
justrec
;
GXV_just_Data
just
=
&
justrec
;
GXV_just_Data
just
=
&
justrec
;
...
@@ -662,14 +662,14 @@
...
@@ -662,14 +662,14 @@
GXV_ODTECT_INIT
(
odtect
);
GXV_ODTECT_INIT
(
odtect
);
valid
->
root
=
ftvalid
;
gx
valid
->
root
=
ftvalid
;
valid
->
table_data
=
just
;
gx
valid
->
table_data
=
just
;
valid
->
face
=
face
;
gx
valid
->
face
=
face
;
FT_TRACE3
((
"validating `just' table
\n
"
));
FT_TRACE3
((
"validating `just' table
\n
"
));
GXV_INIT
;
GXV_INIT
;
limit
=
valid
->
root
->
limit
;
limit
=
gx
valid
->
root
->
limit
;
GXV_LIMIT_CHECK
(
4
+
2
+
2
+
2
);
GXV_LIMIT_CHECK
(
4
+
2
+
2
+
2
);
version
=
FT_NEXT_ULONG
(
p
);
version
=
FT_NEXT_ULONG
(
p
);
...
@@ -696,19 +696,19 @@
...
@@ -696,19 +696,19 @@
/* validate justData */
/* validate justData */
if
(
0
<
horizOffset
)
if
(
0
<
horizOffset
)
{
{
gxv_just_justData_validate
(
table
+
horizOffset
,
limit
,
valid
);
gxv_just_justData_validate
(
table
+
horizOffset
,
limit
,
gx
valid
);
gxv_odtect_add_range
(
table
+
horizOffset
,
valid
->
subtable_length
,
gxv_odtect_add_range
(
table
+
horizOffset
,
gx
valid
->
subtable_length
,
"horizJustData"
,
odtect
);
"horizJustData"
,
odtect
);
}
}
if
(
0
<
vertOffset
)
if
(
0
<
vertOffset
)
{
{
gxv_just_justData_validate
(
table
+
vertOffset
,
limit
,
valid
);
gxv_just_justData_validate
(
table
+
vertOffset
,
limit
,
gx
valid
);
gxv_odtect_add_range
(
table
+
vertOffset
,
valid
->
subtable_length
,
gxv_odtect_add_range
(
table
+
vertOffset
,
gx
valid
->
subtable_length
,
"vertJustData"
,
odtect
);
"vertJustData"
,
odtect
);
}
}
gxv_odtect_validate
(
odtect
,
valid
);
gxv_odtect_validate
(
odtect
,
gx
valid
);
FT_TRACE4
((
"
\n
"
));
FT_TRACE4
((
"
\n
"
));
}
}
...
...
components/external/freetype/src/gxvalid/gxvkern.c
浏览文件 @
2fc33973
...
@@ -79,20 +79,20 @@
...
@@ -79,20 +79,20 @@
#define GXV_KERN_DATA( field ) GXV_TABLE_DATA( kern, field )
#define GXV_KERN_DATA( field ) GXV_TABLE_DATA( kern, field )
#define KERN_IS_CLASSIC( valid ) \
#define KERN_IS_CLASSIC(
gx
valid ) \
( KERN_VERSION_CLASSIC == GXV_KERN_DATA( version ) )
( KERN_VERSION_CLASSIC == GXV_KERN_DATA( version ) )
#define KERN_IS_NEW( valid ) \
#define KERN_IS_NEW(
gx
valid ) \
( KERN_VERSION_NEW == GXV_KERN_DATA( version ) )
( KERN_VERSION_NEW == GXV_KERN_DATA( version ) )
#define KERN_DIALECT( valid ) \
#define KERN_DIALECT(
gx
valid ) \
GXV_KERN_DATA( dialect_request )
GXV_KERN_DATA( dialect_request )
#define KERN_ALLOWS_MS( valid ) \
#define KERN_ALLOWS_MS(
gx
valid ) \
( KERN_DIALECT( valid ) & KERN_DIALECT_MS )
( KERN_DIALECT(
gx
valid ) & KERN_DIALECT_MS )
#define KERN_ALLOWS_APPLE( valid ) \
#define KERN_ALLOWS_APPLE(
gx
valid ) \
( KERN_DIALECT( valid ) & KERN_DIALECT_APPLE )
( KERN_DIALECT(
gx
valid ) & KERN_DIALECT_APPLE )
#define GXV_KERN_HEADER_SIZE ( KERN_IS_NEW( valid ) ? 8 : 4 )
#define GXV_KERN_HEADER_SIZE ( KERN_IS_NEW(
gx
valid ) ? 8 : 4 )
#define GXV_KERN_SUBTABLE_HEADER_SIZE ( KERN_IS_NEW( valid ) ? 8 : 6 )
#define GXV_KERN_SUBTABLE_HEADER_SIZE ( KERN_IS_NEW(
gx
valid ) ? 8 : 6 )
/*************************************************************************/
/*************************************************************************/
...
@@ -110,7 +110,7 @@
...
@@ -110,7 +110,7 @@
gxv_kern_subtable_fmt0_pairs_validate
(
FT_Bytes
table
,
gxv_kern_subtable_fmt0_pairs_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
FT_UShort
nPairs
,
FT_UShort
nPairs
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
FT_UShort
i
;
FT_UShort
i
;
...
@@ -134,11 +134,11 @@
...
@@ -134,11 +134,11 @@
/* left */
/* left */
gid_left
=
FT_NEXT_USHORT
(
p
);
gid_left
=
FT_NEXT_USHORT
(
p
);
gxv_glyphid_validate
(
gid_left
,
valid
);
gxv_glyphid_validate
(
gid_left
,
gx
valid
);
/* right */
/* right */
gid_right
=
FT_NEXT_USHORT
(
p
);
gid_right
=
FT_NEXT_USHORT
(
p
);
gxv_glyphid_validate
(
gid_right
,
valid
);
gxv_glyphid_validate
(
gid_right
,
gx
valid
);
/* Pairs of left and right GIDs must be unique and sorted. */
/* Pairs of left and right GIDs must be unique and sorted. */
GXV_TRACE
((
"left gid = %u, right gid = %u
\n
"
,
gid_left
,
gid_right
));
GXV_TRACE
((
"left gid = %u, right gid = %u
\n
"
,
gid_left
,
gid_right
));
...
@@ -171,7 +171,7 @@
...
@@ -171,7 +171,7 @@
static
void
static
void
gxv_kern_subtable_fmt0_validate
(
FT_Bytes
table
,
gxv_kern_subtable_fmt0_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
table
+
GXV_KERN_SUBTABLE_HEADER_SIZE
;
FT_Bytes
p
=
table
+
GXV_KERN_SUBTABLE_HEADER_SIZE
;
...
@@ -186,10 +186,10 @@
...
@@ -186,10 +186,10 @@
/* nPairs, searchRange, entrySelector, rangeShift */
/* nPairs, searchRange, entrySelector, rangeShift */
GXV_LIMIT_CHECK
(
2
+
2
+
2
+
2
);
GXV_LIMIT_CHECK
(
2
+
2
+
2
+
2
);
gxv_BinSrchHeader_validate
(
p
,
limit
,
&
unitSize
,
&
nPairs
,
valid
);
gxv_BinSrchHeader_validate
(
p
,
limit
,
&
unitSize
,
&
nPairs
,
gx
valid
);
p
+=
2
+
2
+
2
+
2
;
p
+=
2
+
2
+
2
+
2
;
gxv_kern_subtable_fmt0_pairs_validate
(
p
,
limit
,
nPairs
,
valid
);
gxv_kern_subtable_fmt0_pairs_validate
(
p
,
limit
,
nPairs
,
gx
valid
);
GXV_EXIT
;
GXV_EXIT
;
}
}
...
@@ -209,11 +209,11 @@
...
@@ -209,11 +209,11 @@
static
void
static
void
gxv_kern_subtable_fmt1_valueTable_load
(
FT_Bytes
table
,
gxv_kern_subtable_fmt1_valueTable_load
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
GXV_kern_fmt1_StateOptRecData
optdata
=
GXV_kern_fmt1_StateOptRecData
optdata
=
(
GXV_kern_fmt1_StateOptRecData
)
valid
->
statetable
.
optdata
;
(
GXV_kern_fmt1_StateOptRecData
)
gx
valid
->
statetable
.
optdata
;
GXV_LIMIT_CHECK
(
2
);
GXV_LIMIT_CHECK
(
2
);
...
@@ -232,14 +232,14 @@
...
@@ -232,14 +232,14 @@
FT_UShort
*
classTable_length_p
,
FT_UShort
*
classTable_length_p
,
FT_UShort
*
stateArray_length_p
,
FT_UShort
*
stateArray_length_p
,
FT_UShort
*
entryTable_length_p
,
FT_UShort
*
entryTable_length_p
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_UShort
o
[
4
];
FT_UShort
o
[
4
];
FT_UShort
*
l
[
4
];
FT_UShort
*
l
[
4
];
FT_UShort
buff
[
5
];
FT_UShort
buff
[
5
];
GXV_kern_fmt1_StateOptRecData
optdata
=
GXV_kern_fmt1_StateOptRecData
optdata
=
(
GXV_kern_fmt1_StateOptRecData
)
valid
->
statetable
.
optdata
;
(
GXV_kern_fmt1_StateOptRecData
)
gx
valid
->
statetable
.
optdata
;
o
[
0
]
=
classTable
;
o
[
0
]
=
classTable
;
...
@@ -251,7 +251,7 @@
...
@@ -251,7 +251,7 @@
l
[
2
]
=
entryTable_length_p
;
l
[
2
]
=
entryTable_length_p
;
l
[
3
]
=
&
(
optdata
->
valueTable_length
);
l
[
3
]
=
&
(
optdata
->
valueTable_length
);
gxv_set_length_by_ushort_offset
(
o
,
l
,
buff
,
4
,
table_size
,
valid
);
gxv_set_length_by_ushort_offset
(
o
,
l
,
buff
,
4
,
table_size
,
gx
valid
);
}
}
...
@@ -265,7 +265,7 @@
...
@@ -265,7 +265,7 @@
GXV_StateTable_GlyphOffsetCPtr
glyphOffset_p
,
GXV_StateTable_GlyphOffsetCPtr
glyphOffset_p
,
FT_Bytes
table
,
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
#ifdef GXV_LOAD_UNUSED_VARS
#ifdef GXV_LOAD_UNUSED_VARS
FT_UShort
push
;
FT_UShort
push
;
...
@@ -289,7 +289,7 @@
...
@@ -289,7 +289,7 @@
{
{
GXV_kern_fmt1_StateOptRecData
vt_rec
=
GXV_kern_fmt1_StateOptRecData
vt_rec
=
(
GXV_kern_fmt1_StateOptRecData
)
valid
->
statetable
.
optdata
;
(
GXV_kern_fmt1_StateOptRecData
)
gx
valid
->
statetable
.
optdata
;
FT_Bytes
p
;
FT_Bytes
p
;
...
@@ -311,7 +311,7 @@
...
@@ -311,7 +311,7 @@
static
void
static
void
gxv_kern_subtable_fmt1_validate
(
FT_Bytes
table
,
gxv_kern_subtable_fmt1_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
GXV_kern_fmt1_StateOptRec
vt_rec
;
GXV_kern_fmt1_StateOptRec
vt_rec
;
...
@@ -319,18 +319,18 @@
...
@@ -319,18 +319,18 @@
GXV_NAME_ENTER
(
"kern subtable format 1"
);
GXV_NAME_ENTER
(
"kern subtable format 1"
);
valid
->
statetable
.
optdata
=
gx
valid
->
statetable
.
optdata
=
&
vt_rec
;
&
vt_rec
;
valid
->
statetable
.
optdata_load_func
=
gx
valid
->
statetable
.
optdata_load_func
=
gxv_kern_subtable_fmt1_valueTable_load
;
gxv_kern_subtable_fmt1_valueTable_load
;
valid
->
statetable
.
subtable_setup_func
=
gx
valid
->
statetable
.
subtable_setup_func
=
gxv_kern_subtable_fmt1_subtable_setup
;
gxv_kern_subtable_fmt1_subtable_setup
;
valid
->
statetable
.
entry_glyphoffset_fmt
=
gx
valid
->
statetable
.
entry_glyphoffset_fmt
=
GXV_GLYPHOFFSET_NONE
;
GXV_GLYPHOFFSET_NONE
;
valid
->
statetable
.
entry_validate_func
=
gx
valid
->
statetable
.
entry_validate_func
=
gxv_kern_subtable_fmt1_entry_validate
;
gxv_kern_subtable_fmt1_entry_validate
;
gxv_StateTable_validate
(
p
,
limit
,
valid
);
gxv_StateTable_validate
(
p
,
limit
,
gx
valid
);
GXV_EXIT
;
GXV_EXIT
;
}
}
...
@@ -373,7 +373,7 @@
...
@@ -373,7 +373,7 @@
gxv_kern_subtable_fmt2_clstbl_validate
(
FT_Bytes
table
,
gxv_kern_subtable_fmt2_clstbl_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_kern_ClassSpec
spec
,
GXV_kern_ClassSpec
spec
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
const
FT_String
*
tag
=
GXV_KERN_FMT2_DATA
(
class_tag
[
spec
]
);
const
FT_String
*
tag
=
GXV_KERN_FMT2_DATA
(
class_tag
[
spec
]
);
GXV_odtect_Range
odtect
=
GXV_KERN_FMT2_DATA
(
odtect
);
GXV_odtect_Range
odtect
=
GXV_KERN_FMT2_DATA
(
odtect
);
...
@@ -391,13 +391,13 @@
...
@@ -391,13 +391,13 @@
GXV_TRACE
((
" %s firstGlyph=%d, nGlyphs=%d
\n
"
,
GXV_TRACE
((
" %s firstGlyph=%d, nGlyphs=%d
\n
"
,
tag
,
firstGlyph
,
nGlyphs
));
tag
,
firstGlyph
,
nGlyphs
));
gxv_glyphid_validate
(
firstGlyph
,
valid
);
gxv_glyphid_validate
(
firstGlyph
,
gx
valid
);
gxv_glyphid_validate
(
(
FT_UShort
)(
firstGlyph
+
nGlyphs
-
1
),
valid
);
gxv_glyphid_validate
(
(
FT_UShort
)(
firstGlyph
+
nGlyphs
-
1
),
gx
valid
);
gxv_array_getlimits_ushort
(
p
,
p
+
(
2
*
nGlyphs
),
gxv_array_getlimits_ushort
(
p
,
p
+
(
2
*
nGlyphs
),
&
(
GXV_KERN_FMT2_DATA
(
offset_min
[
spec
]
)
),
&
(
GXV_KERN_FMT2_DATA
(
offset_min
[
spec
]
)
),
&
(
GXV_KERN_FMT2_DATA
(
offset_max
[
spec
]
)
),
&
(
GXV_KERN_FMT2_DATA
(
offset_max
[
spec
]
)
),
valid
);
gx
valid
);
gxv_odtect_add_range
(
table
,
2
*
nGlyphs
,
tag
,
odtect
);
gxv_odtect_add_range
(
table
,
2
*
nGlyphs
,
tag
,
odtect
);
...
@@ -408,7 +408,7 @@
...
@@ -408,7 +408,7 @@
static
void
static
void
gxv_kern_subtable_fmt2_validate
(
FT_Bytes
table
,
gxv_kern_subtable_fmt2_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
GXV_ODTECT
(
3
,
odtect
);
GXV_ODTECT
(
3
,
odtect
);
GXV_kern_subtable_fmt2_DataRec
fmt2_rec
=
GXV_kern_subtable_fmt2_DataRec
fmt2_rec
=
...
@@ -439,10 +439,10 @@
...
@@ -439,10 +439,10 @@
GXV_LIMIT_CHECK
(
GXV_KERN_FMT2_DATA
(
array
)
);
GXV_LIMIT_CHECK
(
GXV_KERN_FMT2_DATA
(
array
)
);
gxv_kern_subtable_fmt2_clstbl_validate
(
table
+
leftOffsetTable
,
limit
,
gxv_kern_subtable_fmt2_clstbl_validate
(
table
+
leftOffsetTable
,
limit
,
GXV_KERN_CLS_L
,
valid
);
GXV_KERN_CLS_L
,
gx
valid
);
gxv_kern_subtable_fmt2_clstbl_validate
(
table
+
rightOffsetTable
,
limit
,
gxv_kern_subtable_fmt2_clstbl_validate
(
table
+
rightOffsetTable
,
limit
,
GXV_KERN_CLS_R
,
valid
);
GXV_KERN_CLS_R
,
gx
valid
);
if
(
GXV_KERN_FMT2_DATA
(
offset_min
[
GXV_KERN_CLS_L
]
)
+
if
(
GXV_KERN_FMT2_DATA
(
offset_min
[
GXV_KERN_CLS_L
]
)
+
GXV_KERN_FMT2_DATA
(
offset_min
[
GXV_KERN_CLS_R
]
)
GXV_KERN_FMT2_DATA
(
offset_min
[
GXV_KERN_CLS_R
]
)
...
@@ -455,7 +455,7 @@
...
@@ -455,7 +455,7 @@
-
GXV_KERN_FMT2_DATA
(
array
),
-
GXV_KERN_FMT2_DATA
(
array
),
"array"
,
odtect
);
"array"
,
odtect
);
gxv_odtect_validate
(
odtect
,
valid
);
gxv_odtect_validate
(
odtect
,
gx
valid
);
GXV_EXIT
;
GXV_EXIT
;
}
}
...
@@ -466,7 +466,7 @@
...
@@ -466,7 +466,7 @@
static
void
static
void
gxv_kern_subtable_fmt3_validate
(
FT_Bytes
table
,
gxv_kern_subtable_fmt3_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
table
+
GXV_KERN_SUBTABLE_HEADER_SIZE
;
FT_Bytes
p
=
table
+
GXV_KERN_SUBTABLE_HEADER_SIZE
;
FT_UShort
glyphCount
;
FT_UShort
glyphCount
;
...
@@ -485,10 +485,10 @@
...
@@ -485,10 +485,10 @@
rightClassCount
=
FT_NEXT_BYTE
(
p
);
rightClassCount
=
FT_NEXT_BYTE
(
p
);
flags
=
FT_NEXT_BYTE
(
p
);
flags
=
FT_NEXT_BYTE
(
p
);
if
(
valid
->
face
->
num_glyphs
!=
glyphCount
)
if
(
gx
valid
->
face
->
num_glyphs
!=
glyphCount
)
{
{
GXV_TRACE
((
"maxGID=%d, but glyphCount=%d
\n
"
,
GXV_TRACE
((
"maxGID=%d, but glyphCount=%d
\n
"
,
valid
->
face
->
num_glyphs
,
glyphCount
));
gx
valid
->
face
->
num_glyphs
,
glyphCount
));
GXV_SET_ERR_IF_PARANOID
(
FT_INVALID_GLYPH_ID
);
GXV_SET_ERR_IF_PARANOID
(
FT_INVALID_GLYPH_ID
);
}
}
...
@@ -509,8 +509,8 @@
...
@@ -509,8 +509,8 @@
GXV_LIMIT_CHECK
(
glyphCount
);
GXV_LIMIT_CHECK
(
glyphCount
);
gxv_array_getlimits_byte
(
p
,
p
+
glyphCount
,
&
min
,
&
max
,
valid
);
gxv_array_getlimits_byte
(
p
,
p
+
glyphCount
,
&
min
,
&
max
,
gx
valid
);
p
+=
valid
->
subtable_length
;
p
+=
gx
valid
->
subtable_length
;
if
(
leftClassCount
<
max
)
if
(
leftClassCount
<
max
)
FT_INVALID_DATA
;
FT_INVALID_DATA
;
...
@@ -524,8 +524,8 @@
...
@@ -524,8 +524,8 @@
GXV_LIMIT_CHECK
(
glyphCount
);
GXV_LIMIT_CHECK
(
glyphCount
);
gxv_array_getlimits_byte
(
p
,
p
+
glyphCount
,
&
min
,
&
max
,
valid
);
gxv_array_getlimits_byte
(
p
,
p
+
glyphCount
,
&
min
,
&
max
,
gx
valid
);
p
+=
valid
->
subtable_length
;
p
+=
gx
valid
->
subtable_length
;
if
(
rightClassCount
<
max
)
if
(
rightClassCount
<
max
)
FT_INVALID_DATA
;
FT_INVALID_DATA
;
...
@@ -549,7 +549,7 @@
...
@@ -549,7 +549,7 @@
}
}
}
}
valid
->
subtable_length
=
p
-
table
;
gx
valid
->
subtable_length
=
p
-
table
;
GXV_EXIT
;
GXV_EXIT
;
}
}
...
@@ -558,7 +558,7 @@
...
@@ -558,7 +558,7 @@
static
FT_Bool
static
FT_Bool
gxv_kern_coverage_new_apple_validate
(
FT_UShort
coverage
,
gxv_kern_coverage_new_apple_validate
(
FT_UShort
coverage
,
FT_UShort
*
format
,
FT_UShort
*
format
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
/* new Apple-dialect */
/* new Apple-dialect */
#ifdef GXV_LOAD_TRACE_VARS
#ifdef GXV_LOAD_TRACE_VARS
...
@@ -567,7 +567,7 @@
...
@@ -567,7 +567,7 @@
FT_Bool
kernVariation
;
FT_Bool
kernVariation
;
#endif
#endif
FT_UNUSED
(
valid
);
FT_UNUSED
(
gx
valid
);
/* reserved bits = 0 */
/* reserved bits = 0 */
...
@@ -595,7 +595,7 @@
...
@@ -595,7 +595,7 @@
static
FT_Bool
static
FT_Bool
gxv_kern_coverage_classic_apple_validate
(
FT_UShort
coverage
,
gxv_kern_coverage_classic_apple_validate
(
FT_UShort
coverage
,
FT_UShort
*
format
,
FT_UShort
*
format
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
/* classic Apple-dialect */
/* classic Apple-dialect */
#ifdef GXV_LOAD_TRACE_VARS
#ifdef GXV_LOAD_TRACE_VARS
...
@@ -605,7 +605,7 @@
...
@@ -605,7 +605,7 @@
/* check expected flags, but don't check if MS-dialect is impossible */
/* check expected flags, but don't check if MS-dialect is impossible */
if
(
!
(
coverage
&
0xFD00
)
&&
KERN_ALLOWS_MS
(
valid
)
)
if
(
!
(
coverage
&
0xFD00
)
&&
KERN_ALLOWS_MS
(
gx
valid
)
)
return
FALSE
;
return
FALSE
;
/* reserved bits = 0 */
/* reserved bits = 0 */
...
@@ -636,7 +636,7 @@
...
@@ -636,7 +636,7 @@
static
FT_Bool
static
FT_Bool
gxv_kern_coverage_classic_microsoft_validate
(
FT_UShort
coverage
,
gxv_kern_coverage_classic_microsoft_validate
(
FT_UShort
coverage
,
FT_UShort
*
format
,
FT_UShort
*
format
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
/* classic Microsoft-dialect */
/* classic Microsoft-dialect */
#ifdef GXV_LOAD_TRACE_VARS
#ifdef GXV_LOAD_TRACE_VARS
...
@@ -646,7 +646,7 @@
...
@@ -646,7 +646,7 @@
FT_Bool
override
;
FT_Bool
override
;
#endif
#endif
FT_UNUSED
(
valid
);
FT_UNUSED
(
gx
valid
);
/* reserved bits = 0 */
/* reserved bits = 0 */
...
@@ -686,7 +686,7 @@
...
@@ -686,7 +686,7 @@
static
GXV_kern_Dialect
static
GXV_kern_Dialect
gxv_kern_coverage_validate
(
FT_UShort
coverage
,
gxv_kern_coverage_validate
(
FT_UShort
coverage
,
FT_UShort
*
format
,
FT_UShort
*
format
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
GXV_kern_Dialect
result
=
KERN_DIALECT_UNKNOWN
;
GXV_kern_Dialect
result
=
KERN_DIALECT_UNKNOWN
;
...
@@ -695,33 +695,33 @@
...
@@ -695,33 +695,33 @@
GXV_TRACE
((
"interprete coverage 0x%04x by Apple style
\n
"
,
coverage
));
GXV_TRACE
((
"interprete coverage 0x%04x by Apple style
\n
"
,
coverage
));
if
(
KERN_IS_NEW
(
valid
)
)
if
(
KERN_IS_NEW
(
gx
valid
)
)
{
{
if
(
gxv_kern_coverage_new_apple_validate
(
coverage
,
if
(
gxv_kern_coverage_new_apple_validate
(
coverage
,
format
,
format
,
valid
)
)
gx
valid
)
)
{
{
result
=
KERN_DIALECT_APPLE
;
result
=
KERN_DIALECT_APPLE
;
goto
Exit
;
goto
Exit
;
}
}
}
}
if
(
KERN_IS_CLASSIC
(
valid
)
&&
KERN_ALLOWS_APPLE
(
valid
)
)
if
(
KERN_IS_CLASSIC
(
gxvalid
)
&&
KERN_ALLOWS_APPLE
(
gx
valid
)
)
{
{
if
(
gxv_kern_coverage_classic_apple_validate
(
coverage
,
if
(
gxv_kern_coverage_classic_apple_validate
(
coverage
,
format
,
format
,
valid
)
)
gx
valid
)
)
{
{
result
=
KERN_DIALECT_APPLE
;
result
=
KERN_DIALECT_APPLE
;
goto
Exit
;
goto
Exit
;
}
}
}
}
if
(
KERN_IS_CLASSIC
(
valid
)
&&
KERN_ALLOWS_MS
(
valid
)
)
if
(
KERN_IS_CLASSIC
(
gxvalid
)
&&
KERN_ALLOWS_MS
(
gx
valid
)
)
{
{
if
(
gxv_kern_coverage_classic_microsoft_validate
(
coverage
,
if
(
gxv_kern_coverage_classic_microsoft_validate
(
coverage
,
format
,
format
,
valid
)
)
gx
valid
)
)
{
{
result
=
KERN_DIALECT_MS
;
result
=
KERN_DIALECT_MS
;
goto
Exit
;
goto
Exit
;
...
@@ -739,7 +739,7 @@
...
@@ -739,7 +739,7 @@
static
void
static
void
gxv_kern_subtable_validate
(
FT_Bytes
table
,
gxv_kern_subtable_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
#ifdef GXV_LOAD_TRACE_VARS
#ifdef GXV_LOAD_TRACE_VARS
...
@@ -761,7 +761,7 @@
...
@@ -761,7 +761,7 @@
u16
[
1
]
=
FT_NEXT_USHORT
(
p
);
/* Apple: length_lo MS: length */
u16
[
1
]
=
FT_NEXT_USHORT
(
p
);
/* Apple: length_lo MS: length */
coverage
=
FT_NEXT_USHORT
(
p
);
coverage
=
FT_NEXT_USHORT
(
p
);
switch
(
gxv_kern_coverage_validate
(
coverage
,
&
format
,
valid
)
)
switch
(
gxv_kern_coverage_validate
(
coverage
,
&
format
,
gx
valid
)
)
{
{
case
KERN_DIALECT_MS
:
case
KERN_DIALECT_MS
:
#ifdef GXV_LOAD_TRACE_VARS
#ifdef GXV_LOAD_TRACE_VARS
...
@@ -785,7 +785,7 @@
...
@@ -785,7 +785,7 @@
#endif
#endif
GXV_TRACE
((
"Subtable length = %d
\n
"
,
length
));
GXV_TRACE
((
"Subtable length = %d
\n
"
,
length
));
if
(
KERN_IS_NEW
(
valid
)
)
if
(
KERN_IS_NEW
(
gx
valid
)
)
{
{
GXV_LIMIT_CHECK
(
2
);
GXV_LIMIT_CHECK
(
2
);
#ifdef GXV_LOAD_TRACE_VARS
#ifdef GXV_LOAD_TRACE_VARS
...
@@ -806,18 +806,18 @@
...
@@ -806,18 +806,18 @@
/* formats 1, 2, 3 require the position of the start of this subtable */
/* formats 1, 2, 3 require the position of the start of this subtable */
if
(
format
==
0
)
if
(
format
==
0
)
gxv_kern_subtable_fmt0_validate
(
table
,
table
+
length
,
valid
);
gxv_kern_subtable_fmt0_validate
(
table
,
table
+
length
,
gx
valid
);
else
if
(
format
==
1
)
else
if
(
format
==
1
)
gxv_kern_subtable_fmt1_validate
(
table
,
table
+
length
,
valid
);
gxv_kern_subtable_fmt1_validate
(
table
,
table
+
length
,
gx
valid
);
else
if
(
format
==
2
)
else
if
(
format
==
2
)
gxv_kern_subtable_fmt2_validate
(
table
,
table
+
length
,
valid
);
gxv_kern_subtable_fmt2_validate
(
table
,
table
+
length
,
gx
valid
);
else
if
(
format
==
3
)
else
if
(
format
==
3
)
gxv_kern_subtable_fmt3_validate
(
table
,
table
+
length
,
valid
);
gxv_kern_subtable_fmt3_validate
(
table
,
table
+
length
,
gx
valid
);
else
else
FT_INVALID_DATA
;
FT_INVALID_DATA
;
Exit:
Exit:
valid
->
subtable_length
=
length
;
gx
valid
->
subtable_length
=
length
;
GXV_EXIT
;
GXV_EXIT
;
}
}
...
@@ -837,8 +837,8 @@
...
@@ -837,8 +837,8 @@
GXV_kern_Dialect
dialect_request
,
GXV_kern_Dialect
dialect_request
,
FT_Validator
ftvalid
)
FT_Validator
ftvalid
)
{
{
GXV_ValidatorRec
validrec
;
GXV_ValidatorRec
gx
validrec
;
GXV_Validator
valid
=
&
validrec
;
GXV_Validator
gxvalid
=
&
gx
validrec
;
GXV_kern_DataRec
kernrec
;
GXV_kern_DataRec
kernrec
;
GXV_kern_Data
kern
=
&
kernrec
;
GXV_kern_Data
kern
=
&
kernrec
;
...
@@ -850,13 +850,13 @@
...
@@ -850,13 +850,13 @@
FT_UInt
i
;
FT_UInt
i
;
valid
->
root
=
ftvalid
;
gx
valid
->
root
=
ftvalid
;
valid
->
table_data
=
kern
;
gx
valid
->
table_data
=
kern
;
valid
->
face
=
face
;
gx
valid
->
face
=
face
;
FT_TRACE3
((
"validating `kern' table
\n
"
));
FT_TRACE3
((
"validating `kern' table
\n
"
));
GXV_INIT
;
GXV_INIT
;
KERN_DIALECT
(
valid
)
=
dialect_request
;
KERN_DIALECT
(
gx
valid
)
=
dialect_request
;
GXV_LIMIT_CHECK
(
2
);
GXV_LIMIT_CHECK
(
2
);
GXV_KERN_DATA
(
version
)
=
(
GXV_kern_Version
)
FT_NEXT_USHORT
(
p
);
GXV_KERN_DATA
(
version
)
=
(
GXV_kern_Version
)
FT_NEXT_USHORT
(
p
);
...
@@ -865,12 +865,12 @@
...
@@ -865,12 +865,12 @@
if
(
0x0001
<
GXV_KERN_DATA
(
version
)
)
if
(
0x0001
<
GXV_KERN_DATA
(
version
)
)
FT_INVALID_FORMAT
;
FT_INVALID_FORMAT
;
else
if
(
KERN_IS_CLASSIC
(
valid
)
)
else
if
(
KERN_IS_CLASSIC
(
gx
valid
)
)
{
{
GXV_LIMIT_CHECK
(
2
);
GXV_LIMIT_CHECK
(
2
);
nTables
=
FT_NEXT_USHORT
(
p
);
nTables
=
FT_NEXT_USHORT
(
p
);
}
}
else
if
(
KERN_IS_NEW
(
valid
)
)
else
if
(
KERN_IS_NEW
(
gx
valid
)
)
{
{
if
(
classic_only
)
if
(
classic_only
)
FT_INVALID_FORMAT
;
FT_INVALID_FORMAT
;
...
@@ -886,8 +886,8 @@
...
@@ -886,8 +886,8 @@
{
{
GXV_TRACE
((
"validating subtable %d/%d
\n
"
,
i
,
nTables
));
GXV_TRACE
((
"validating subtable %d/%d
\n
"
,
i
,
nTables
));
/* p should be 32bit-aligned? */
/* p should be 32bit-aligned? */
gxv_kern_subtable_validate
(
p
,
0
,
valid
);
gxv_kern_subtable_validate
(
p
,
0
,
gx
valid
);
p
+=
valid
->
subtable_length
;
p
+=
gx
valid
->
subtable_length
;
}
}
FT_TRACE4
((
"
\n
"
));
FT_TRACE4
((
"
\n
"
));
...
...
components/external/freetype/src/gxvalid/gxvlcar.c
浏览文件 @
2fc33973
...
@@ -67,14 +67,14 @@
...
@@ -67,14 +67,14 @@
static
void
static
void
gxv_lcar_partial_validate
(
FT_UShort
partial
,
gxv_lcar_partial_validate
(
FT_UShort
partial
,
FT_UShort
glyph
,
FT_UShort
glyph
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
GXV_NAME_ENTER
(
"partial"
);
GXV_NAME_ENTER
(
"partial"
);
if
(
GXV_LCAR_DATA
(
format
)
!=
1
)
if
(
GXV_LCAR_DATA
(
format
)
!=
1
)
goto
Exit
;
goto
Exit
;
gxv_ctlPoint_validate
(
glyph
,
partial
,
valid
);
gxv_ctlPoint_validate
(
glyph
,
partial
,
gx
valid
);
Exit:
Exit:
GXV_EXIT
;
GXV_EXIT
;
...
@@ -84,10 +84,10 @@
...
@@ -84,10 +84,10 @@
static
void
static
void
gxv_lcar_LookupValue_validate
(
FT_UShort
glyph
,
gxv_lcar_LookupValue_validate
(
FT_UShort
glyph
,
GXV_LookupValueCPtr
value_p
,
GXV_LookupValueCPtr
value_p
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
valid
->
root
->
base
+
value_p
->
u
;
FT_Bytes
p
=
gx
valid
->
root
->
base
+
value_p
->
u
;
FT_Bytes
limit
=
valid
->
root
->
limit
;
FT_Bytes
limit
=
gx
valid
->
root
->
limit
;
FT_UShort
count
;
FT_UShort
count
;
FT_Short
partial
;
FT_Short
partial
;
FT_UShort
i
;
FT_UShort
i
;
...
@@ -102,7 +102,7 @@
...
@@ -102,7 +102,7 @@
for
(
i
=
0
;
i
<
count
;
i
++
)
for
(
i
=
0
;
i
<
count
;
i
++
)
{
{
partial
=
FT_NEXT_SHORT
(
p
);
partial
=
FT_NEXT_SHORT
(
p
);
gxv_lcar_partial_validate
(
partial
,
glyph
,
valid
);
gxv_lcar_partial_validate
(
partial
,
glyph
,
gx
valid
);
}
}
GXV_EXIT
;
GXV_EXIT
;
...
@@ -148,7 +148,7 @@
...
@@ -148,7 +148,7 @@
gxv_lcar_LookupFmt4_transit
(
FT_UShort
relative_gindex
,
gxv_lcar_LookupFmt4_transit
(
FT_UShort
relative_gindex
,
GXV_LookupValueCPtr
base_value_p
,
GXV_LookupValueCPtr
base_value_p
,
FT_Bytes
lookuptbl_limit
,
FT_Bytes
lookuptbl_limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
;
FT_Bytes
p
;
FT_Bytes
limit
;
FT_Bytes
limit
;
...
@@ -160,8 +160,8 @@
...
@@ -160,8 +160,8 @@
/* XXX: check range? */
/* XXX: check range? */
offset
=
(
FT_UShort
)(
base_value_p
->
u
+
offset
=
(
FT_UShort
)(
base_value_p
->
u
+
relative_gindex
*
sizeof
(
FT_UShort
)
);
relative_gindex
*
sizeof
(
FT_UShort
)
);
p
=
valid
->
root
->
base
+
offset
;
p
=
gx
valid
->
root
->
base
+
offset
;
limit
=
valid
->
root
->
limit
;
limit
=
gx
valid
->
root
->
limit
;
GXV_LIMIT_CHECK
(
2
);
GXV_LIMIT_CHECK
(
2
);
value
.
u
=
FT_NEXT_USHORT
(
p
);
value
.
u
=
FT_NEXT_USHORT
(
p
);
...
@@ -185,8 +185,8 @@
...
@@ -185,8 +185,8 @@
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
FT_Bytes
limit
=
0
;
FT_Bytes
limit
=
0
;
GXV_ValidatorRec
validrec
;
GXV_ValidatorRec
gx
validrec
;
GXV_Validator
valid
=
&
validrec
;
GXV_Validator
gxvalid
=
&
gx
validrec
;
GXV_lcar_DataRec
lcarrec
;
GXV_lcar_DataRec
lcarrec
;
GXV_lcar_Data
lcar
=
&
lcarrec
;
GXV_lcar_Data
lcar
=
&
lcarrec
;
...
@@ -194,9 +194,9 @@
...
@@ -194,9 +194,9 @@
FT_Fixed
version
;
FT_Fixed
version
;
valid
->
root
=
ftvalid
;
gx
valid
->
root
=
ftvalid
;
valid
->
table_data
=
lcar
;
gx
valid
->
table_data
=
lcar
;
valid
->
face
=
face
;
gx
valid
->
face
=
face
;
FT_TRACE3
((
"validating `lcar' table
\n
"
));
FT_TRACE3
((
"validating `lcar' table
\n
"
));
GXV_INIT
;
GXV_INIT
;
...
@@ -211,10 +211,10 @@
...
@@ -211,10 +211,10 @@
if
(
GXV_LCAR_DATA
(
format
)
>
1
)
if
(
GXV_LCAR_DATA
(
format
)
>
1
)
FT_INVALID_FORMAT
;
FT_INVALID_FORMAT
;
valid
->
lookupval_sign
=
GXV_LOOKUPVALUE_UNSIGNED
;
gx
valid
->
lookupval_sign
=
GXV_LOOKUPVALUE_UNSIGNED
;
valid
->
lookupval_func
=
gxv_lcar_LookupValue_validate
;
gx
valid
->
lookupval_func
=
gxv_lcar_LookupValue_validate
;
valid
->
lookupfmt4_trans
=
gxv_lcar_LookupFmt4_transit
;
gx
valid
->
lookupfmt4_trans
=
gxv_lcar_LookupFmt4_transit
;
gxv_LookupTable_validate
(
p
,
limit
,
valid
);
gxv_LookupTable_validate
(
p
,
limit
,
gx
valid
);
FT_TRACE4
((
"
\n
"
));
FT_TRACE4
((
"
\n
"
));
}
}
...
...
components/external/freetype/src/gxvalid/gxvmort.c
浏览文件 @
2fc33973
...
@@ -40,7 +40,7 @@
...
@@ -40,7 +40,7 @@
static
void
static
void
gxv_mort_feature_validate
(
GXV_mort_feature
f
,
gxv_mort_feature_validate
(
GXV_mort_feature
f
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
if
(
f
->
featureType
>=
gxv_feat_registry_length
)
if
(
f
->
featureType
>=
gxv_feat_registry_length
)
{
{
...
@@ -89,7 +89,7 @@
...
@@ -89,7 +89,7 @@
gxv_mort_featurearray_validate
(
FT_Bytes
table
,
gxv_mort_featurearray_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
FT_ULong
nFeatureFlags
,
FT_ULong
nFeatureFlags
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
FT_ULong
i
;
FT_ULong
i
;
...
@@ -106,22 +106,22 @@
...
@@ -106,22 +106,22 @@
f
.
enableFlags
=
FT_NEXT_ULONG
(
p
);
f
.
enableFlags
=
FT_NEXT_ULONG
(
p
);
f
.
disableFlags
=
FT_NEXT_ULONG
(
p
);
f
.
disableFlags
=
FT_NEXT_ULONG
(
p
);
gxv_mort_feature_validate
(
&
f
,
valid
);
gxv_mort_feature_validate
(
&
f
,
gx
valid
);
}
}
if
(
!
IS_GXV_MORT_FEATURE_OFF
(
f
)
)
if
(
!
IS_GXV_MORT_FEATURE_OFF
(
f
)
)
FT_INVALID_DATA
;
FT_INVALID_DATA
;
valid
->
subtable_length
=
p
-
table
;
gx
valid
->
subtable_length
=
p
-
table
;
GXV_EXIT
;
GXV_EXIT
;
}
}
FT_LOCAL_DEF
(
void
)
FT_LOCAL_DEF
(
void
)
gxv_mort_coverage_validate
(
FT_UShort
coverage
,
gxv_mort_coverage_validate
(
FT_UShort
coverage
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_UNUSED
(
valid
);
FT_UNUSED
(
gx
valid
);
#ifdef FT_DEBUG_LEVEL_TRACE
#ifdef FT_DEBUG_LEVEL_TRACE
if
(
coverage
&
0x8000U
)
if
(
coverage
&
0x8000U
)
...
@@ -150,7 +150,7 @@
...
@@ -150,7 +150,7 @@
gxv_mort_subtables_validate
(
FT_Bytes
table
,
gxv_mort_subtables_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
FT_UShort
nSubtables
,
FT_UShort
nSubtables
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
...
@@ -198,7 +198,7 @@
...
@@ -198,7 +198,7 @@
rest
=
length
-
(
2
+
2
+
4
);
rest
=
length
-
(
2
+
2
+
4
);
GXV_LIMIT_CHECK
(
rest
);
GXV_LIMIT_CHECK
(
rest
);
gxv_mort_coverage_validate
(
coverage
,
valid
);
gxv_mort_coverage_validate
(
coverage
,
gx
valid
);
if
(
type
>
5
)
if
(
type
>
5
)
FT_INVALID_FORMAT
;
FT_INVALID_FORMAT
;
...
@@ -207,13 +207,13 @@
...
@@ -207,13 +207,13 @@
if
(
func
==
NULL
)
if
(
func
==
NULL
)
GXV_TRACE
((
"morx type %d is reserved
\n
"
,
type
));
GXV_TRACE
((
"morx type %d is reserved
\n
"
,
type
));
func
(
p
,
p
+
rest
,
valid
);
func
(
p
,
p
+
rest
,
gx
valid
);
p
+=
rest
;
p
+=
rest
;
/* TODO: validate subFeatureFlags */
/* TODO: validate subFeatureFlags */
}
}
valid
->
subtable_length
=
p
-
table
;
gx
valid
->
subtable_length
=
p
-
table
;
GXV_EXIT
;
GXV_EXIT
;
}
}
...
@@ -222,7 +222,7 @@
...
@@ -222,7 +222,7 @@
static
void
static
void
gxv_mort_chain_validate
(
FT_Bytes
table
,
gxv_mort_chain_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
#ifdef GXV_LOAD_UNUSED_VARS
#ifdef GXV_LOAD_UNUSED_VARS
...
@@ -246,10 +246,10 @@
...
@@ -246,10 +246,10 @@
nSubtables
=
FT_NEXT_USHORT
(
p
);
nSubtables
=
FT_NEXT_USHORT
(
p
);
gxv_mort_featurearray_validate
(
p
,
table
+
chainLength
,
gxv_mort_featurearray_validate
(
p
,
table
+
chainLength
,
nFeatureFlags
,
valid
);
nFeatureFlags
,
gx
valid
);
p
+=
valid
->
subtable_length
;
p
+=
gx
valid
->
subtable_length
;
gxv_mort_subtables_validate
(
p
,
table
+
chainLength
,
nSubtables
,
valid
);
gxv_mort_subtables_validate
(
p
,
table
+
chainLength
,
nSubtables
,
gx
valid
);
valid
->
subtable_length
=
chainLength
;
gx
valid
->
subtable_length
=
chainLength
;
/* TODO: validate defaultFlags */
/* TODO: validate defaultFlags */
GXV_EXIT
;
GXV_EXIT
;
...
@@ -261,8 +261,8 @@
...
@@ -261,8 +261,8 @@
FT_Face
face
,
FT_Face
face
,
FT_Validator
ftvalid
)
FT_Validator
ftvalid
)
{
{
GXV_ValidatorRec
validrec
;
GXV_ValidatorRec
gx
validrec
;
GXV_Validator
valid
=
&
validrec
;
GXV_Validator
gxvalid
=
&
gx
validrec
;
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
FT_Bytes
limit
=
0
;
FT_Bytes
limit
=
0
;
FT_ULong
version
;
FT_ULong
version
;
...
@@ -270,9 +270,9 @@
...
@@ -270,9 +270,9 @@
FT_ULong
i
;
FT_ULong
i
;
valid
->
root
=
ftvalid
;
gx
valid
->
root
=
ftvalid
;
valid
->
face
=
face
;
gx
valid
->
face
=
face
;
limit
=
valid
->
root
->
limit
;
limit
=
gx
valid
->
root
->
limit
;
FT_TRACE3
((
"validating `mort' table
\n
"
));
FT_TRACE3
((
"validating `mort' table
\n
"
));
GXV_INIT
;
GXV_INIT
;
...
@@ -288,8 +288,8 @@
...
@@ -288,8 +288,8 @@
{
{
GXV_TRACE
((
"validating chain %d/%d
\n
"
,
i
+
1
,
nChains
));
GXV_TRACE
((
"validating chain %d/%d
\n
"
,
i
+
1
,
nChains
));
GXV_32BIT_ALIGNMENT_VALIDATE
(
p
-
table
);
GXV_32BIT_ALIGNMENT_VALIDATE
(
p
-
table
);
gxv_mort_chain_validate
(
p
,
limit
,
valid
);
gxv_mort_chain_validate
(
p
,
limit
,
gx
valid
);
p
+=
valid
->
subtable_length
;
p
+=
gx
valid
->
subtable_length
;
}
}
FT_TRACE4
((
"
\n
"
));
FT_TRACE4
((
"
\n
"
));
...
...
components/external/freetype/src/gxvalid/gxvmort.h
浏览文件 @
2fc33973
...
@@ -55,36 +55,36 @@
...
@@ -55,36 +55,36 @@
gxv_mort_featurearray_validate
(
FT_Bytes
table
,
gxv_mort_featurearray_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
FT_ULong
nFeatureFlags
,
FT_ULong
nFeatureFlags
,
GXV_Validator
valid
);
GXV_Validator
gx
valid
);
FT_LOCAL
(
void
)
FT_LOCAL
(
void
)
gxv_mort_coverage_validate
(
FT_UShort
coverage
,
gxv_mort_coverage_validate
(
FT_UShort
coverage
,
GXV_Validator
valid
);
GXV_Validator
gx
valid
);
FT_LOCAL
(
void
)
FT_LOCAL
(
void
)
gxv_mort_subtable_type0_validate
(
FT_Bytes
table
,
gxv_mort_subtable_type0_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
);
GXV_Validator
gx
valid
);
FT_LOCAL
(
void
)
FT_LOCAL
(
void
)
gxv_mort_subtable_type1_validate
(
FT_Bytes
table
,
gxv_mort_subtable_type1_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
);
GXV_Validator
gx
valid
);
FT_LOCAL
(
void
)
FT_LOCAL
(
void
)
gxv_mort_subtable_type2_validate
(
FT_Bytes
table
,
gxv_mort_subtable_type2_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
);
GXV_Validator
gx
valid
);
FT_LOCAL
(
void
)
FT_LOCAL
(
void
)
gxv_mort_subtable_type4_validate
(
FT_Bytes
table
,
gxv_mort_subtable_type4_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
);
GXV_Validator
gx
valid
);
FT_LOCAL
(
void
)
FT_LOCAL
(
void
)
gxv_mort_subtable_type5_validate
(
FT_Bytes
table
,
gxv_mort_subtable_type5_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
);
GXV_Validator
gx
valid
);
#endif
/* __GXVMORT_H__ */
#endif
/* __GXVMORT_H__ */
...
...
components/external/freetype/src/gxvalid/gxvmort0.c
浏览文件 @
2fc33973
...
@@ -67,7 +67,7 @@
...
@@ -67,7 +67,7 @@
GXV_StateTable_GlyphOffsetCPtr
glyphOffset_p
,
GXV_StateTable_GlyphOffsetCPtr
glyphOffset_p
,
FT_Bytes
table
,
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_UShort
markFirst
;
FT_UShort
markFirst
;
FT_UShort
dontAdvance
;
FT_UShort
dontAdvance
;
...
@@ -125,7 +125,7 @@
...
@@ -125,7 +125,7 @@
FT_LOCAL_DEF
(
void
)
FT_LOCAL_DEF
(
void
)
gxv_mort_subtable_type0_validate
(
FT_Bytes
table
,
gxv_mort_subtable_type0_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
...
@@ -135,14 +135,14 @@
...
@@ -135,14 +135,14 @@
GXV_LIMIT_CHECK
(
GXV_STATETABLE_HEADER_SIZE
);
GXV_LIMIT_CHECK
(
GXV_STATETABLE_HEADER_SIZE
);
valid
->
statetable
.
optdata
=
NULL
;
gx
valid
->
statetable
.
optdata
=
NULL
;
valid
->
statetable
.
optdata_load_func
=
NULL
;
gx
valid
->
statetable
.
optdata_load_func
=
NULL
;
valid
->
statetable
.
subtable_setup_func
=
NULL
;
gx
valid
->
statetable
.
subtable_setup_func
=
NULL
;
valid
->
statetable
.
entry_glyphoffset_fmt
=
GXV_GLYPHOFFSET_NONE
;
gx
valid
->
statetable
.
entry_glyphoffset_fmt
=
GXV_GLYPHOFFSET_NONE
;
valid
->
statetable
.
entry_validate_func
=
gx
valid
->
statetable
.
entry_validate_func
=
gxv_mort_subtable_type0_entry_validate
;
gxv_mort_subtable_type0_entry_validate
;
gxv_StateTable_validate
(
p
,
limit
,
valid
);
gxv_StateTable_validate
(
p
,
limit
,
gx
valid
);
GXV_EXIT
;
GXV_EXIT
;
}
}
...
...
components/external/freetype/src/gxvalid/gxvmort1.c
浏览文件 @
2fc33973
...
@@ -53,12 +53,12 @@
...
@@ -53,12 +53,12 @@
static
void
static
void
gxv_mort_subtable_type1_substitutionTable_load
(
FT_Bytes
table
,
gxv_mort_subtable_type1_substitutionTable_load
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
GXV_mort_subtable_type1_StateOptRecData
optdata
=
GXV_mort_subtable_type1_StateOptRecData
optdata
=
(
GXV_mort_subtable_type1_StateOptRecData
)
valid
->
statetable
.
optdata
;
(
GXV_mort_subtable_type1_StateOptRecData
)
gx
valid
->
statetable
.
optdata
;
GXV_LIMIT_CHECK
(
2
);
GXV_LIMIT_CHECK
(
2
);
...
@@ -74,14 +74,14 @@
...
@@ -74,14 +74,14 @@
FT_UShort
*
classTable_length_p
,
FT_UShort
*
classTable_length_p
,
FT_UShort
*
stateArray_length_p
,
FT_UShort
*
stateArray_length_p
,
FT_UShort
*
entryTable_length_p
,
FT_UShort
*
entryTable_length_p
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_UShort
o
[
4
];
FT_UShort
o
[
4
];
FT_UShort
*
l
[
4
];
FT_UShort
*
l
[
4
];
FT_UShort
buff
[
5
];
FT_UShort
buff
[
5
];
GXV_mort_subtable_type1_StateOptRecData
optdata
=
GXV_mort_subtable_type1_StateOptRecData
optdata
=
(
GXV_mort_subtable_type1_StateOptRecData
)
valid
->
statetable
.
optdata
;
(
GXV_mort_subtable_type1_StateOptRecData
)
gx
valid
->
statetable
.
optdata
;
o
[
0
]
=
classTable
;
o
[
0
]
=
classTable
;
...
@@ -93,7 +93,7 @@
...
@@ -93,7 +93,7 @@
l
[
2
]
=
entryTable_length_p
;
l
[
2
]
=
entryTable_length_p
;
l
[
3
]
=
&
(
optdata
->
substitutionTable_length
);
l
[
3
]
=
&
(
optdata
->
substitutionTable_length
);
gxv_set_length_by_ushort_offset
(
o
,
l
,
buff
,
4
,
table_size
,
valid
);
gxv_set_length_by_ushort_offset
(
o
,
l
,
buff
,
4
,
table_size
,
gx
valid
);
}
}
...
@@ -102,7 +102,7 @@
...
@@ -102,7 +102,7 @@
FT_Short
wordOffset
,
FT_Short
wordOffset
,
const
FT_String
*
tag
,
const
FT_String
*
tag
,
FT_Byte
state
,
FT_Byte
state
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_UShort
substTable
;
FT_UShort
substTable
;
FT_UShort
substTable_limit
;
FT_UShort
substTable_limit
;
...
@@ -113,16 +113,16 @@
...
@@ -113,16 +113,16 @@
substTable
=
substTable
=
((
GXV_mort_subtable_type1_StateOptRec
*
)
((
GXV_mort_subtable_type1_StateOptRec
*
)
(
valid
->
statetable
.
optdata
))
->
substitutionTable
;
(
gx
valid
->
statetable
.
optdata
))
->
substitutionTable
;
substTable_limit
=
substTable_limit
=
(
FT_UShort
)(
substTable
+
(
FT_UShort
)(
substTable
+
((
GXV_mort_subtable_type1_StateOptRec
*
)
((
GXV_mort_subtable_type1_StateOptRec
*
)
(
valid
->
statetable
.
optdata
))
->
substitutionTable_length
);
(
gx
valid
->
statetable
.
optdata
))
->
substitutionTable_length
);
valid
->
min_gid
=
(
FT_UShort
)(
(
substTable
-
wordOffset
*
2
)
/
2
);
gx
valid
->
min_gid
=
(
FT_UShort
)(
(
substTable
-
wordOffset
*
2
)
/
2
);
valid
->
max_gid
=
(
FT_UShort
)(
(
substTable_limit
-
wordOffset
*
2
)
/
2
);
gx
valid
->
max_gid
=
(
FT_UShort
)(
(
substTable_limit
-
wordOffset
*
2
)
/
2
);
valid
->
max_gid
=
(
FT_UShort
)(
FT_MAX
(
valid
->
max_gid
,
gxvalid
->
max_gid
=
(
FT_UShort
)(
FT_MAX
(
gx
valid
->
max_gid
,
valid
->
face
->
num_glyphs
)
);
gx
valid
->
face
->
num_glyphs
)
);
/* XXX: check range? */
/* XXX: check range? */
...
@@ -137,7 +137,7 @@
...
@@ -137,7 +137,7 @@
GXV_StateTable_GlyphOffsetCPtr
glyphOffset_p
,
GXV_StateTable_GlyphOffsetCPtr
glyphOffset_p
,
FT_Bytes
table
,
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
#ifdef GXV_LOAD_UNUSED_VARS
#ifdef GXV_LOAD_UNUSED_VARS
FT_UShort
setMark
;
FT_UShort
setMark
;
...
@@ -169,24 +169,24 @@
...
@@ -169,24 +169,24 @@
gxv_mort_subtable_type1_offset_to_subst_validate
(
markOffset
,
gxv_mort_subtable_type1_offset_to_subst_validate
(
markOffset
,
"markOffset"
,
"markOffset"
,
state
,
state
,
valid
);
gx
valid
);
gxv_mort_subtable_type1_offset_to_subst_validate
(
currentOffset
,
gxv_mort_subtable_type1_offset_to_subst_validate
(
currentOffset
,
"currentOffset"
,
"currentOffset"
,
state
,
state
,
valid
);
gx
valid
);
}
}
static
void
static
void
gxv_mort_subtable_type1_substTable_validate
(
FT_Bytes
table
,
gxv_mort_subtable_type1_substTable_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
FT_UShort
num_gids
=
(
FT_UShort
)(
FT_UShort
num_gids
=
(
FT_UShort
)(
((
GXV_mort_subtable_type1_StateOptRec
*
)
((
GXV_mort_subtable_type1_StateOptRec
*
)
(
valid
->
statetable
.
optdata
))
->
substitutionTable_length
/
2
);
(
gx
valid
->
statetable
.
optdata
))
->
substitutionTable_length
/
2
);
FT_UShort
i
;
FT_UShort
i
;
...
@@ -202,11 +202,11 @@
...
@@ -202,11 +202,11 @@
if
(
dst_gid
>=
0xFFFFU
)
if
(
dst_gid
>=
0xFFFFU
)
continue
;
continue
;
if
(
dst_gid
<
valid
->
min_gid
||
valid
->
max_gid
<
dst_gid
)
if
(
dst_gid
<
gxvalid
->
min_gid
||
gx
valid
->
max_gid
<
dst_gid
)
{
{
GXV_TRACE
((
"substTable include a strange gid[%d]=%d >"
GXV_TRACE
((
"substTable include a strange gid[%d]=%d >"
" out of define range (%d..%d)
\n
"
,
" out of define range (%d..%d)
\n
"
,
i
,
dst_gid
,
valid
->
min_gid
,
valid
->
max_gid
));
i
,
dst_gid
,
gxvalid
->
min_gid
,
gx
valid
->
max_gid
));
GXV_SET_ERR_IF_PARANOID
(
FT_INVALID_GLYPH_ID
);
GXV_SET_ERR_IF_PARANOID
(
FT_INVALID_GLYPH_ID
);
}
}
}
}
...
@@ -223,7 +223,7 @@
...
@@ -223,7 +223,7 @@
FT_LOCAL_DEF
(
void
)
FT_LOCAL_DEF
(
void
)
gxv_mort_subtable_type1_validate
(
FT_Bytes
table
,
gxv_mort_subtable_type1_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
...
@@ -234,23 +234,23 @@
...
@@ -234,23 +234,23 @@
GXV_LIMIT_CHECK
(
GXV_MORT_SUBTABLE_TYPE1_HEADER_SIZE
);
GXV_LIMIT_CHECK
(
GXV_MORT_SUBTABLE_TYPE1_HEADER_SIZE
);
valid
->
statetable
.
optdata
=
gx
valid
->
statetable
.
optdata
=
&
st_rec
;
&
st_rec
;
valid
->
statetable
.
optdata_load_func
=
gx
valid
->
statetable
.
optdata_load_func
=
gxv_mort_subtable_type1_substitutionTable_load
;
gxv_mort_subtable_type1_substitutionTable_load
;
valid
->
statetable
.
subtable_setup_func
=
gx
valid
->
statetable
.
subtable_setup_func
=
gxv_mort_subtable_type1_subtable_setup
;
gxv_mort_subtable_type1_subtable_setup
;
valid
->
statetable
.
entry_glyphoffset_fmt
=
gx
valid
->
statetable
.
entry_glyphoffset_fmt
=
GXV_GLYPHOFFSET_ULONG
;
GXV_GLYPHOFFSET_ULONG
;
valid
->
statetable
.
entry_validate_func
=
gx
valid
->
statetable
.
entry_validate_func
=
gxv_mort_subtable_type1_entry_validate
;
gxv_mort_subtable_type1_entry_validate
;
gxv_StateTable_validate
(
p
,
limit
,
valid
);
gxv_StateTable_validate
(
p
,
limit
,
gx
valid
);
gxv_mort_subtable_type1_substTable_validate
(
gxv_mort_subtable_type1_substTable_validate
(
table
+
st_rec
.
substitutionTable
,
table
+
st_rec
.
substitutionTable
,
table
+
st_rec
.
substitutionTable
+
st_rec
.
substitutionTable_length
,
table
+
st_rec
.
substitutionTable
+
st_rec
.
substitutionTable_length
,
valid
);
gx
valid
);
GXV_EXIT
;
GXV_EXIT
;
}
}
...
...
components/external/freetype/src/gxvalid/gxvmort2.c
浏览文件 @
2fc33973
...
@@ -57,11 +57,11 @@
...
@@ -57,11 +57,11 @@
static
void
static
void
gxv_mort_subtable_type2_opttable_load
(
FT_Bytes
table
,
gxv_mort_subtable_type2_opttable_load
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
GXV_mort_subtable_type2_StateOptRecData
optdata
=
GXV_mort_subtable_type2_StateOptRecData
optdata
=
(
GXV_mort_subtable_type2_StateOptRecData
)
valid
->
statetable
.
optdata
;
(
GXV_mort_subtable_type2_StateOptRecData
)
gx
valid
->
statetable
.
optdata
;
GXV_LIMIT_CHECK
(
2
+
2
+
2
);
GXV_LIMIT_CHECK
(
2
+
2
+
2
);
...
@@ -86,14 +86,14 @@
...
@@ -86,14 +86,14 @@
FT_UShort
*
classTable_length_p
,
FT_UShort
*
classTable_length_p
,
FT_UShort
*
stateArray_length_p
,
FT_UShort
*
stateArray_length_p
,
FT_UShort
*
entryTable_length_p
,
FT_UShort
*
entryTable_length_p
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_UShort
o
[
6
];
FT_UShort
o
[
6
];
FT_UShort
*
l
[
6
];
FT_UShort
*
l
[
6
];
FT_UShort
buff
[
7
];
FT_UShort
buff
[
7
];
GXV_mort_subtable_type2_StateOptRecData
optdata
=
GXV_mort_subtable_type2_StateOptRecData
optdata
=
(
GXV_mort_subtable_type2_StateOptRecData
)
valid
->
statetable
.
optdata
;
(
GXV_mort_subtable_type2_StateOptRecData
)
gx
valid
->
statetable
.
optdata
;
GXV_NAME_ENTER
(
"subtable boundaries setup"
);
GXV_NAME_ENTER
(
"subtable boundaries setup"
);
...
@@ -111,7 +111,7 @@
...
@@ -111,7 +111,7 @@
l
[
4
]
=
&
(
optdata
->
componentTable_length
);
l
[
4
]
=
&
(
optdata
->
componentTable_length
);
l
[
5
]
=
&
(
optdata
->
ligatureTable_length
);
l
[
5
]
=
&
(
optdata
->
ligatureTable_length
);
gxv_set_length_by_ushort_offset
(
o
,
l
,
buff
,
6
,
table_size
,
valid
);
gxv_set_length_by_ushort_offset
(
o
,
l
,
buff
,
6
,
table_size
,
gx
valid
);
GXV_TRACE
((
"classTable: offset=0x%04x length=0x%04x
\n
"
,
GXV_TRACE
((
"classTable: offset=0x%04x length=0x%04x
\n
"
,
classTable
,
*
classTable_length_p
));
classTable
,
*
classTable_length_p
));
...
@@ -137,11 +137,11 @@
...
@@ -137,11 +137,11 @@
gxv_mort_subtable_type2_ligActionOffset_validate
(
gxv_mort_subtable_type2_ligActionOffset_validate
(
FT_Bytes
table
,
FT_Bytes
table
,
FT_UShort
ligActionOffset
,
FT_UShort
ligActionOffset
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
/* access ligActionTable */
/* access ligActionTable */
GXV_mort_subtable_type2_StateOptRecData
optdata
=
GXV_mort_subtable_type2_StateOptRecData
optdata
=
(
GXV_mort_subtable_type2_StateOptRecData
)
valid
->
statetable
.
optdata
;
(
GXV_mort_subtable_type2_StateOptRecData
)
gx
valid
->
statetable
.
optdata
;
FT_Bytes
lat_base
=
table
+
optdata
->
ligActionTable
;
FT_Bytes
lat_base
=
table
+
optdata
->
ligActionTable
;
FT_Bytes
p
=
table
+
ligActionOffset
;
FT_Bytes
p
=
table
+
ligActionOffset
;
...
@@ -214,7 +214,7 @@
...
@@ -214,7 +214,7 @@
GXV_StateTable_GlyphOffsetCPtr
glyphOffset_p
,
GXV_StateTable_GlyphOffsetCPtr
glyphOffset_p
,
FT_Bytes
table
,
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
#ifdef GXV_LOAD_UNUSED_VARS
#ifdef GXV_LOAD_UNUSED_VARS
FT_UShort
setComponent
;
FT_UShort
setComponent
;
...
@@ -236,16 +236,16 @@
...
@@ -236,16 +236,16 @@
if
(
0
<
offset
)
if
(
0
<
offset
)
gxv_mort_subtable_type2_ligActionOffset_validate
(
table
,
offset
,
gxv_mort_subtable_type2_ligActionOffset_validate
(
table
,
offset
,
valid
);
gx
valid
);
}
}
static
void
static
void
gxv_mort_subtable_type2_ligatureTable_validate
(
FT_Bytes
table
,
gxv_mort_subtable_type2_ligatureTable_validate
(
FT_Bytes
table
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
GXV_mort_subtable_type2_StateOptRecData
optdata
=
GXV_mort_subtable_type2_StateOptRecData
optdata
=
(
GXV_mort_subtable_type2_StateOptRecData
)
valid
->
statetable
.
optdata
;
(
GXV_mort_subtable_type2_StateOptRecData
)
gx
valid
->
statetable
.
optdata
;
FT_Bytes
p
=
table
+
optdata
->
ligatureTable
;
FT_Bytes
p
=
table
+
optdata
->
ligatureTable
;
FT_Bytes
limit
=
table
+
optdata
->
ligatureTable
FT_Bytes
limit
=
table
+
optdata
->
ligatureTable
...
@@ -264,7 +264,7 @@
...
@@ -264,7 +264,7 @@
GXV_LIMIT_CHECK
(
2
);
GXV_LIMIT_CHECK
(
2
);
lig_gid
=
FT_NEXT_USHORT
(
p
);
lig_gid
=
FT_NEXT_USHORT
(
p
);
if
(
valid
->
face
->
num_glyphs
<
lig_gid
)
if
(
gx
valid
->
face
->
num_glyphs
<
lig_gid
)
GXV_SET_ERR_IF_PARANOID
(
FT_INVALID_GLYPH_ID
);
GXV_SET_ERR_IF_PARANOID
(
FT_INVALID_GLYPH_ID
);
}
}
}
}
...
@@ -275,7 +275,7 @@
...
@@ -275,7 +275,7 @@
FT_LOCAL_DEF
(
void
)
FT_LOCAL_DEF
(
void
)
gxv_mort_subtable_type2_validate
(
FT_Bytes
table
,
gxv_mort_subtable_type2_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
...
@@ -286,23 +286,23 @@
...
@@ -286,23 +286,23 @@
GXV_LIMIT_CHECK
(
GXV_MORT_SUBTABLE_TYPE2_HEADER_SIZE
);
GXV_LIMIT_CHECK
(
GXV_MORT_SUBTABLE_TYPE2_HEADER_SIZE
);
valid
->
statetable
.
optdata
=
gx
valid
->
statetable
.
optdata
=
&
lig_rec
;
&
lig_rec
;
valid
->
statetable
.
optdata_load_func
=
gx
valid
->
statetable
.
optdata_load_func
=
gxv_mort_subtable_type2_opttable_load
;
gxv_mort_subtable_type2_opttable_load
;
valid
->
statetable
.
subtable_setup_func
=
gx
valid
->
statetable
.
subtable_setup_func
=
gxv_mort_subtable_type2_subtable_setup
;
gxv_mort_subtable_type2_subtable_setup
;
valid
->
statetable
.
entry_glyphoffset_fmt
=
gx
valid
->
statetable
.
entry_glyphoffset_fmt
=
GXV_GLYPHOFFSET_NONE
;
GXV_GLYPHOFFSET_NONE
;
valid
->
statetable
.
entry_validate_func
=
gx
valid
->
statetable
.
entry_validate_func
=
gxv_mort_subtable_type2_entry_validate
;
gxv_mort_subtable_type2_entry_validate
;
gxv_StateTable_validate
(
p
,
limit
,
valid
);
gxv_StateTable_validate
(
p
,
limit
,
gx
valid
);
p
+=
valid
->
subtable_length
;
p
+=
gx
valid
->
subtable_length
;
gxv_mort_subtable_type2_ligatureTable_validate
(
table
,
valid
);
gxv_mort_subtable_type2_ligatureTable_validate
(
table
,
gx
valid
);
valid
->
subtable_length
=
p
-
table
;
gx
valid
->
subtable_length
=
p
-
table
;
GXV_EXIT
;
GXV_EXIT
;
}
}
...
...
components/external/freetype/src/gxvalid/gxvmort4.c
浏览文件 @
2fc33973
...
@@ -41,11 +41,11 @@
...
@@ -41,11 +41,11 @@
static
void
static
void
gxv_mort_subtable_type4_lookupval_validate
(
FT_UShort
glyph
,
gxv_mort_subtable_type4_lookupval_validate
(
FT_UShort
glyph
,
GXV_LookupValueCPtr
value_p
,
GXV_LookupValueCPtr
value_p
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_UNUSED
(
glyph
);
FT_UNUSED
(
glyph
);
gxv_glyphid_validate
(
value_p
->
u
,
valid
);
gxv_glyphid_validate
(
value_p
->
u
,
gx
valid
);
}
}
/*
/*
...
@@ -80,7 +80,7 @@
...
@@ -80,7 +80,7 @@
FT_UShort
relative_gindex
,
FT_UShort
relative_gindex
,
GXV_LookupValueCPtr
base_value_p
,
GXV_LookupValueCPtr
base_value_p
,
FT_Bytes
lookuptbl_limit
,
FT_Bytes
lookuptbl_limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
;
FT_Bytes
p
;
FT_Bytes
limit
;
FT_Bytes
limit
;
...
@@ -91,7 +91,7 @@
...
@@ -91,7 +91,7 @@
offset
=
(
FT_UShort
)(
base_value_p
->
u
+
offset
=
(
FT_UShort
)(
base_value_p
->
u
+
relative_gindex
*
sizeof
(
FT_UShort
)
);
relative_gindex
*
sizeof
(
FT_UShort
)
);
p
=
valid
->
lookuptbl_head
+
offset
;
p
=
gx
valid
->
lookuptbl_head
+
offset
;
limit
=
lookuptbl_limit
;
limit
=
lookuptbl_limit
;
GXV_LIMIT_CHECK
(
2
);
GXV_LIMIT_CHECK
(
2
);
...
@@ -104,7 +104,7 @@
...
@@ -104,7 +104,7 @@
FT_LOCAL_DEF
(
void
)
FT_LOCAL_DEF
(
void
)
gxv_mort_subtable_type4_validate
(
FT_Bytes
table
,
gxv_mort_subtable_type4_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
...
@@ -112,11 +112,11 @@
...
@@ -112,11 +112,11 @@
GXV_NAME_ENTER
(
"mort chain subtable type4 "
GXV_NAME_ENTER
(
"mort chain subtable type4 "
"(Non-Contextual Glyph Substitution)"
);
"(Non-Contextual Glyph Substitution)"
);
valid
->
lookupval_sign
=
GXV_LOOKUPVALUE_UNSIGNED
;
gx
valid
->
lookupval_sign
=
GXV_LOOKUPVALUE_UNSIGNED
;
valid
->
lookupval_func
=
gxv_mort_subtable_type4_lookupval_validate
;
gx
valid
->
lookupval_func
=
gxv_mort_subtable_type4_lookupval_validate
;
valid
->
lookupfmt4_trans
=
gxv_mort_subtable_type4_lookupfmt4_transit
;
gx
valid
->
lookupfmt4_trans
=
gxv_mort_subtable_type4_lookupfmt4_transit
;
gxv_LookupTable_validate
(
p
,
limit
,
valid
);
gxv_LookupTable_validate
(
p
,
limit
,
gx
valid
);
GXV_EXIT
;
GXV_EXIT
;
}
}
...
...
components/external/freetype/src/gxvalid/gxvmort5.c
浏览文件 @
2fc33973
...
@@ -70,10 +70,10 @@
...
@@ -70,10 +70,10 @@
FT_UShort
*
classTable_length_p
,
FT_UShort
*
classTable_length_p
,
FT_UShort
*
stateArray_length_p
,
FT_UShort
*
stateArray_length_p
,
FT_UShort
*
entryTable_length_p
,
FT_UShort
*
entryTable_length_p
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
GXV_mort_subtable_type5_StateOptRecData
optdata
=
GXV_mort_subtable_type5_StateOptRecData
optdata
=
(
GXV_mort_subtable_type5_StateOptRecData
)
valid
->
statetable
.
optdata
;
(
GXV_mort_subtable_type5_StateOptRecData
)
gx
valid
->
statetable
.
optdata
;
gxv_StateTable_subtable_setup
(
table_size
,
gxv_StateTable_subtable_setup
(
table_size
,
...
@@ -83,7 +83,7 @@
...
@@ -83,7 +83,7 @@
classTable_length_p
,
classTable_length_p
,
stateArray_length_p
,
stateArray_length_p
,
entryTable_length_p
,
entryTable_length_p
,
valid
);
gx
valid
);
optdata
->
classTable
=
classTable
;
optdata
->
classTable
=
classTable
;
optdata
->
stateArray
=
stateArray
;
optdata
->
stateArray
=
stateArray
;
...
@@ -100,7 +100,7 @@
...
@@ -100,7 +100,7 @@
FT_UShort
count
,
FT_UShort
count
,
FT_Bytes
table
,
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
/*
/*
* We don't know the range of insertion-glyph-list.
* We don't know the range of insertion-glyph-list.
...
@@ -109,7 +109,7 @@
...
@@ -109,7 +109,7 @@
FT_Bytes
p
=
table
+
offset
;
FT_Bytes
p
=
table
+
offset
;
GXV_mort_subtable_type5_StateOptRecData
optdata
=
GXV_mort_subtable_type5_StateOptRecData
optdata
=
(
GXV_mort_subtable_type5_StateOptRecData
)
valid
->
statetable
.
optdata
;
(
GXV_mort_subtable_type5_StateOptRecData
)
gx
valid
->
statetable
.
optdata
;
if
(
optdata
->
classTable
<
offset
&&
if
(
optdata
->
classTable
<
offset
&&
offset
<
optdata
->
classTable
+
*
(
optdata
->
classTable_length_p
)
)
offset
<
optdata
->
classTable
+
*
(
optdata
->
classTable_length_p
)
)
...
@@ -145,7 +145,7 @@
...
@@ -145,7 +145,7 @@
GXV_StateTable_GlyphOffsetCPtr
glyphOffset
,
GXV_StateTable_GlyphOffsetCPtr
glyphOffset
,
FT_Bytes
table
,
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
#ifdef GXV_LOAD_UNUSED_VARS
#ifdef GXV_LOAD_UNUSED_VARS
FT_Bool
setMark
;
FT_Bool
setMark
;
...
@@ -184,7 +184,7 @@
...
@@ -184,7 +184,7 @@
currentInsertCount
,
currentInsertCount
,
table
,
table
,
limit
,
limit
,
valid
);
gx
valid
);
}
}
if
(
0
!=
markedInsertList
&&
0
!=
markedInsertCount
)
if
(
0
!=
markedInsertList
&&
0
!=
markedInsertCount
)
...
@@ -193,7 +193,7 @@
...
@@ -193,7 +193,7 @@
markedInsertCount
,
markedInsertCount
,
table
,
table
,
limit
,
limit
,
valid
);
gx
valid
);
}
}
}
}
...
@@ -201,7 +201,7 @@
...
@@ -201,7 +201,7 @@
FT_LOCAL_DEF
(
void
)
FT_LOCAL_DEF
(
void
)
gxv_mort_subtable_type5_validate
(
FT_Bytes
table
,
gxv_mort_subtable_type5_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
...
@@ -213,18 +213,18 @@
...
@@ -213,18 +213,18 @@
GXV_LIMIT_CHECK
(
GXV_MORT_SUBTABLE_TYPE5_HEADER_SIZE
);
GXV_LIMIT_CHECK
(
GXV_MORT_SUBTABLE_TYPE5_HEADER_SIZE
);
valid
->
statetable
.
optdata
=
gx
valid
->
statetable
.
optdata
=
et
;
et
;
valid
->
statetable
.
optdata_load_func
=
gx
valid
->
statetable
.
optdata_load_func
=
NULL
;
NULL
;
valid
->
statetable
.
subtable_setup_func
=
gx
valid
->
statetable
.
subtable_setup_func
=
gxv_mort_subtable_type5_subtable_setup
;
gxv_mort_subtable_type5_subtable_setup
;
valid
->
statetable
.
entry_glyphoffset_fmt
=
gx
valid
->
statetable
.
entry_glyphoffset_fmt
=
GXV_GLYPHOFFSET_ULONG
;
GXV_GLYPHOFFSET_ULONG
;
valid
->
statetable
.
entry_validate_func
=
gx
valid
->
statetable
.
entry_validate_func
=
gxv_mort_subtable_type5_entry_validate
;
gxv_mort_subtable_type5_entry_validate
;
gxv_StateTable_validate
(
p
,
limit
,
valid
);
gxv_StateTable_validate
(
p
,
limit
,
gx
valid
);
GXV_EXIT
;
GXV_EXIT
;
}
}
...
...
components/external/freetype/src/gxvalid/gxvmorx.c
浏览文件 @
2fc33973
...
@@ -42,7 +42,7 @@
...
@@ -42,7 +42,7 @@
gxv_morx_subtables_validate
(
FT_Bytes
table
,
gxv_morx_subtables_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
FT_UShort
nSubtables
,
FT_UShort
nSubtables
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
...
@@ -93,7 +93,7 @@
...
@@ -93,7 +93,7 @@
/* morx coverage consists of mort_coverage & 16bit padding */
/* morx coverage consists of mort_coverage & 16bit padding */
gxv_mort_coverage_validate
(
(
FT_UShort
)(
(
coverage
>>
16
)
|
coverage
),
gxv_mort_coverage_validate
(
(
FT_UShort
)(
(
coverage
>>
16
)
|
coverage
),
valid
);
gx
valid
);
if
(
type
>
5
)
if
(
type
>
5
)
FT_INVALID_FORMAT
;
FT_INVALID_FORMAT
;
...
@@ -101,13 +101,13 @@
...
@@ -101,13 +101,13 @@
if
(
func
==
NULL
)
if
(
func
==
NULL
)
GXV_TRACE
((
"morx type %d is reserved
\n
"
,
type
));
GXV_TRACE
((
"morx type %d is reserved
\n
"
,
type
));
func
(
p
,
p
+
rest
,
valid
);
func
(
p
,
p
+
rest
,
gx
valid
);
/* TODO: subFeatureFlags should be unique in a table? */
/* TODO: subFeatureFlags should be unique in a table? */
p
+=
rest
;
p
+=
rest
;
}
}
valid
->
subtable_length
=
p
-
table
;
gx
valid
->
subtable_length
=
p
-
table
;
GXV_EXIT
;
GXV_EXIT
;
}
}
...
@@ -116,7 +116,7 @@
...
@@ -116,7 +116,7 @@
static
void
static
void
gxv_morx_chain_validate
(
FT_Bytes
table
,
gxv_morx_chain_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
#ifdef GXV_LOAD_UNUSED_VARS
#ifdef GXV_LOAD_UNUSED_VARS
...
@@ -140,16 +140,16 @@
...
@@ -140,16 +140,16 @@
nSubtables
=
FT_NEXT_ULONG
(
p
);
nSubtables
=
FT_NEXT_ULONG
(
p
);
/* feature-array of morx is same with that of mort */
/* feature-array of morx is same with that of mort */
gxv_mort_featurearray_validate
(
p
,
limit
,
nFeatureFlags
,
valid
);
gxv_mort_featurearray_validate
(
p
,
limit
,
nFeatureFlags
,
gx
valid
);
p
+=
valid
->
subtable_length
;
p
+=
gx
valid
->
subtable_length
;
if
(
nSubtables
>=
0x10000L
)
if
(
nSubtables
>=
0x10000L
)
FT_INVALID_DATA
;
FT_INVALID_DATA
;
gxv_morx_subtables_validate
(
p
,
table
+
chainLength
,
gxv_morx_subtables_validate
(
p
,
table
+
chainLength
,
(
FT_UShort
)
nSubtables
,
valid
);
(
FT_UShort
)
nSubtables
,
gx
valid
);
valid
->
subtable_length
=
chainLength
;
gx
valid
->
subtable_length
=
chainLength
;
/* TODO: defaultFlags should be compared with the flags in tables */
/* TODO: defaultFlags should be compared with the flags in tables */
...
@@ -162,8 +162,8 @@
...
@@ -162,8 +162,8 @@
FT_Face
face
,
FT_Face
face
,
FT_Validator
ftvalid
)
FT_Validator
ftvalid
)
{
{
GXV_ValidatorRec
validrec
;
GXV_ValidatorRec
gx
validrec
;
GXV_Validator
valid
=
&
validrec
;
GXV_Validator
gxvalid
=
&
gx
validrec
;
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
FT_Bytes
limit
=
0
;
FT_Bytes
limit
=
0
;
FT_ULong
version
;
FT_ULong
version
;
...
@@ -171,8 +171,8 @@
...
@@ -171,8 +171,8 @@
FT_ULong
i
;
FT_ULong
i
;
valid
->
root
=
ftvalid
;
gx
valid
->
root
=
ftvalid
;
valid
->
face
=
face
;
gx
valid
->
face
=
face
;
FT_TRACE3
((
"validating `morx' table
\n
"
));
FT_TRACE3
((
"validating `morx' table
\n
"
));
GXV_INIT
;
GXV_INIT
;
...
@@ -188,8 +188,8 @@
...
@@ -188,8 +188,8 @@
{
{
GXV_TRACE
((
"validating chain %d/%d
\n
"
,
i
+
1
,
nChains
));
GXV_TRACE
((
"validating chain %d/%d
\n
"
,
i
+
1
,
nChains
));
GXV_32BIT_ALIGNMENT_VALIDATE
(
p
-
table
);
GXV_32BIT_ALIGNMENT_VALIDATE
(
p
-
table
);
gxv_morx_chain_validate
(
p
,
limit
,
valid
);
gxv_morx_chain_validate
(
p
,
limit
,
gx
valid
);
p
+=
valid
->
subtable_length
;
p
+=
gx
valid
->
subtable_length
;
}
}
FT_TRACE4
((
"
\n
"
));
FT_TRACE4
((
"
\n
"
));
...
...
components/external/freetype/src/gxvalid/gxvmorx.h
浏览文件 @
2fc33973
...
@@ -38,27 +38,27 @@
...
@@ -38,27 +38,27 @@
FT_LOCAL
(
void
)
FT_LOCAL
(
void
)
gxv_morx_subtable_type0_validate
(
FT_Bytes
table
,
gxv_morx_subtable_type0_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
);
GXV_Validator
gx
valid
);
FT_LOCAL
(
void
)
FT_LOCAL
(
void
)
gxv_morx_subtable_type1_validate
(
FT_Bytes
table
,
gxv_morx_subtable_type1_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
);
GXV_Validator
gx
valid
);
FT_LOCAL
(
void
)
FT_LOCAL
(
void
)
gxv_morx_subtable_type2_validate
(
FT_Bytes
table
,
gxv_morx_subtable_type2_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
);
GXV_Validator
gx
valid
);
FT_LOCAL
(
void
)
FT_LOCAL
(
void
)
gxv_morx_subtable_type4_validate
(
FT_Bytes
table
,
gxv_morx_subtable_type4_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
);
GXV_Validator
gx
valid
);
FT_LOCAL
(
void
)
FT_LOCAL
(
void
)
gxv_morx_subtable_type5_validate
(
FT_Bytes
table
,
gxv_morx_subtable_type5_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
);
GXV_Validator
gx
valid
);
#endif
/* __GXVMORX_H__ */
#endif
/* __GXVMORX_H__ */
...
...
components/external/freetype/src/gxvalid/gxvmorx0.c
浏览文件 @
2fc33973
...
@@ -45,7 +45,7 @@
...
@@ -45,7 +45,7 @@
GXV_XStateTable_GlyphOffsetCPtr
glyphOffset_p
,
GXV_XStateTable_GlyphOffsetCPtr
glyphOffset_p
,
FT_Bytes
table
,
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
#ifdef GXV_LOAD_UNUSED_VARS
#ifdef GXV_LOAD_UNUSED_VARS
FT_UShort
markFirst
;
FT_UShort
markFirst
;
...
@@ -85,7 +85,7 @@
...
@@ -85,7 +85,7 @@
FT_LOCAL_DEF
(
void
)
FT_LOCAL_DEF
(
void
)
gxv_morx_subtable_type0_validate
(
FT_Bytes
table
,
gxv_morx_subtable_type0_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
...
@@ -95,14 +95,14 @@
...
@@ -95,14 +95,14 @@
GXV_LIMIT_CHECK
(
GXV_STATETABLE_HEADER_SIZE
);
GXV_LIMIT_CHECK
(
GXV_STATETABLE_HEADER_SIZE
);
valid
->
xstatetable
.
optdata
=
NULL
;
gx
valid
->
xstatetable
.
optdata
=
NULL
;
valid
->
xstatetable
.
optdata_load_func
=
NULL
;
gx
valid
->
xstatetable
.
optdata_load_func
=
NULL
;
valid
->
xstatetable
.
subtable_setup_func
=
NULL
;
gx
valid
->
xstatetable
.
subtable_setup_func
=
NULL
;
valid
->
xstatetable
.
entry_glyphoffset_fmt
=
GXV_GLYPHOFFSET_NONE
;
gx
valid
->
xstatetable
.
entry_glyphoffset_fmt
=
GXV_GLYPHOFFSET_NONE
;
valid
->
xstatetable
.
entry_validate_func
=
gx
valid
->
xstatetable
.
entry_validate_func
=
gxv_morx_subtable_type0_entry_validate
;
gxv_morx_subtable_type0_entry_validate
;
gxv_XStateTable_validate
(
p
,
limit
,
valid
);
gxv_XStateTable_validate
(
p
,
limit
,
gx
valid
);
GXV_EXIT
;
GXV_EXIT
;
}
}
...
...
components/external/freetype/src/gxvalid/gxvmorx1.c
浏览文件 @
2fc33973
...
@@ -55,12 +55,12 @@
...
@@ -55,12 +55,12 @@
static
void
static
void
gxv_morx_subtable_type1_substitutionTable_load
(
FT_Bytes
table
,
gxv_morx_subtable_type1_substitutionTable_load
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
GXV_morx_subtable_type1_StateOptRecData
optdata
=
GXV_morx_subtable_type1_StateOptRecData
optdata
=
(
GXV_morx_subtable_type1_StateOptRecData
)
valid
->
xstatetable
.
optdata
;
(
GXV_morx_subtable_type1_StateOptRecData
)
gx
valid
->
xstatetable
.
optdata
;
GXV_LIMIT_CHECK
(
2
);
GXV_LIMIT_CHECK
(
2
);
...
@@ -76,14 +76,14 @@
...
@@ -76,14 +76,14 @@
FT_ULong
*
classTable_length_p
,
FT_ULong
*
classTable_length_p
,
FT_ULong
*
stateArray_length_p
,
FT_ULong
*
stateArray_length_p
,
FT_ULong
*
entryTable_length_p
,
FT_ULong
*
entryTable_length_p
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_ULong
o
[
4
];
FT_ULong
o
[
4
];
FT_ULong
*
l
[
4
];
FT_ULong
*
l
[
4
];
FT_ULong
buff
[
5
];
FT_ULong
buff
[
5
];
GXV_morx_subtable_type1_StateOptRecData
optdata
=
GXV_morx_subtable_type1_StateOptRecData
optdata
=
(
GXV_morx_subtable_type1_StateOptRecData
)
valid
->
xstatetable
.
optdata
;
(
GXV_morx_subtable_type1_StateOptRecData
)
gx
valid
->
xstatetable
.
optdata
;
o
[
0
]
=
classTable
;
o
[
0
]
=
classTable
;
...
@@ -95,7 +95,7 @@
...
@@ -95,7 +95,7 @@
l
[
2
]
=
entryTable_length_p
;
l
[
2
]
=
entryTable_length_p
;
l
[
3
]
=
&
(
optdata
->
substitutionTable_length
);
l
[
3
]
=
&
(
optdata
->
substitutionTable_length
);
gxv_set_length_by_ulong_offset
(
o
,
l
,
buff
,
4
,
table_size
,
valid
);
gxv_set_length_by_ulong_offset
(
o
,
l
,
buff
,
4
,
table_size
,
gx
valid
);
}
}
...
@@ -106,7 +106,7 @@
...
@@ -106,7 +106,7 @@
GXV_StateTable_GlyphOffsetCPtr
glyphOffset_p
,
GXV_StateTable_GlyphOffsetCPtr
glyphOffset_p
,
FT_Bytes
table
,
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
#ifdef GXV_LOAD_TRACE_VARS
#ifdef GXV_LOAD_TRACE_VARS
FT_UShort
setMark
;
FT_UShort
setMark
;
...
@@ -117,7 +117,7 @@
...
@@ -117,7 +117,7 @@
FT_Short
currentIndex
;
FT_Short
currentIndex
;
GXV_morx_subtable_type1_StateOptRecData
optdata
=
GXV_morx_subtable_type1_StateOptRecData
optdata
=
(
GXV_morx_subtable_type1_StateOptRecData
)
valid
->
xstatetable
.
optdata
;
(
GXV_morx_subtable_type1_StateOptRecData
)
gx
valid
->
xstatetable
.
optdata
;
FT_UNUSED
(
state
);
FT_UNUSED
(
state
);
FT_UNUSED
(
table
);
FT_UNUSED
(
table
);
...
@@ -159,13 +159,13 @@
...
@@ -159,13 +159,13 @@
static
void
static
void
gxv_morx_subtable_type1_LookupValue_validate
(
FT_UShort
glyph
,
gxv_morx_subtable_type1_LookupValue_validate
(
FT_UShort
glyph
,
GXV_LookupValueCPtr
value_p
,
GXV_LookupValueCPtr
value_p
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_UNUSED
(
glyph
);
/* for the non-debugging case */
FT_UNUSED
(
glyph
);
/* for the non-debugging case */
GXV_TRACE
((
"morx subtable type1 subst.: %d -> %d
\n
"
,
glyph
,
value_p
->
u
));
GXV_TRACE
((
"morx subtable type1 subst.: %d -> %d
\n
"
,
glyph
,
value_p
->
u
));
if
(
value_p
->
u
>
valid
->
face
->
num_glyphs
)
if
(
value_p
->
u
>
gx
valid
->
face
->
num_glyphs
)
FT_INVALID_GLYPH_ID
;
FT_INVALID_GLYPH_ID
;
}
}
...
@@ -175,7 +175,7 @@
...
@@ -175,7 +175,7 @@
FT_UShort
relative_gindex
,
FT_UShort
relative_gindex
,
GXV_LookupValueCPtr
base_value_p
,
GXV_LookupValueCPtr
base_value_p
,
FT_Bytes
lookuptbl_limit
,
FT_Bytes
lookuptbl_limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
;
FT_Bytes
p
;
FT_Bytes
limit
;
FT_Bytes
limit
;
...
@@ -186,7 +186,7 @@
...
@@ -186,7 +186,7 @@
offset
=
(
FT_UShort
)(
base_value_p
->
u
+
offset
=
(
FT_UShort
)(
base_value_p
->
u
+
relative_gindex
*
sizeof
(
FT_UShort
)
);
relative_gindex
*
sizeof
(
FT_UShort
)
);
p
=
valid
->
lookuptbl_head
+
offset
;
p
=
gx
valid
->
lookuptbl_head
+
offset
;
limit
=
lookuptbl_limit
;
limit
=
lookuptbl_limit
;
GXV_LIMIT_CHECK
(
2
);
GXV_LIMIT_CHECK
(
2
);
...
@@ -202,19 +202,19 @@
...
@@ -202,19 +202,19 @@
static
void
static
void
gxv_morx_subtable_type1_substitutionTable_validate
(
FT_Bytes
table
,
gxv_morx_subtable_type1_substitutionTable_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
FT_UShort
i
;
FT_UShort
i
;
GXV_morx_subtable_type1_StateOptRecData
optdata
=
GXV_morx_subtable_type1_StateOptRecData
optdata
=
(
GXV_morx_subtable_type1_StateOptRecData
)
valid
->
xstatetable
.
optdata
;
(
GXV_morx_subtable_type1_StateOptRecData
)
gx
valid
->
xstatetable
.
optdata
;
/* TODO: calculate offset/length for each lookupTables */
/* TODO: calculate offset/length for each lookupTables */
valid
->
lookupval_sign
=
GXV_LOOKUPVALUE_UNSIGNED
;
gx
valid
->
lookupval_sign
=
GXV_LOOKUPVALUE_UNSIGNED
;
valid
->
lookupval_func
=
gxv_morx_subtable_type1_LookupValue_validate
;
gx
valid
->
lookupval_func
=
gxv_morx_subtable_type1_LookupValue_validate
;
valid
->
lookupfmt4_trans
=
gxv_morx_subtable_type1_LookupFmt4_transit
;
gx
valid
->
lookupfmt4_trans
=
gxv_morx_subtable_type1_LookupFmt4_transit
;
for
(
i
=
0
;
i
<
optdata
->
substitutionTable_num_lookupTables
;
i
++
)
for
(
i
=
0
;
i
<
optdata
->
substitutionTable_num_lookupTables
;
i
++
)
{
{
...
@@ -224,7 +224,7 @@
...
@@ -224,7 +224,7 @@
GXV_LIMIT_CHECK
(
4
);
GXV_LIMIT_CHECK
(
4
);
offset
=
FT_NEXT_ULONG
(
p
);
offset
=
FT_NEXT_ULONG
(
p
);
gxv_LookupTable_validate
(
table
+
offset
,
limit
,
valid
);
gxv_LookupTable_validate
(
table
+
offset
,
limit
,
gx
valid
);
}
}
/* TODO: overlapping of lookupTables in substitutionTable */
/* TODO: overlapping of lookupTables in substitutionTable */
...
@@ -239,7 +239,7 @@
...
@@ -239,7 +239,7 @@
FT_LOCAL_DEF
(
void
)
FT_LOCAL_DEF
(
void
)
gxv_morx_subtable_type1_validate
(
FT_Bytes
table
,
gxv_morx_subtable_type1_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
...
@@ -252,23 +252,23 @@
...
@@ -252,23 +252,23 @@
st_rec
.
substitutionTable_num_lookupTables
=
0
;
st_rec
.
substitutionTable_num_lookupTables
=
0
;
valid
->
xstatetable
.
optdata
=
gx
valid
->
xstatetable
.
optdata
=
&
st_rec
;
&
st_rec
;
valid
->
xstatetable
.
optdata_load_func
=
gx
valid
->
xstatetable
.
optdata_load_func
=
gxv_morx_subtable_type1_substitutionTable_load
;
gxv_morx_subtable_type1_substitutionTable_load
;
valid
->
xstatetable
.
subtable_setup_func
=
gx
valid
->
xstatetable
.
subtable_setup_func
=
gxv_morx_subtable_type1_subtable_setup
;
gxv_morx_subtable_type1_subtable_setup
;
valid
->
xstatetable
.
entry_glyphoffset_fmt
=
gx
valid
->
xstatetable
.
entry_glyphoffset_fmt
=
GXV_GLYPHOFFSET_ULONG
;
GXV_GLYPHOFFSET_ULONG
;
valid
->
xstatetable
.
entry_validate_func
=
gx
valid
->
xstatetable
.
entry_validate_func
=
gxv_morx_subtable_type1_entry_validate
;
gxv_morx_subtable_type1_entry_validate
;
gxv_XStateTable_validate
(
p
,
limit
,
valid
);
gxv_XStateTable_validate
(
p
,
limit
,
gx
valid
);
gxv_morx_subtable_type1_substitutionTable_validate
(
gxv_morx_subtable_type1_substitutionTable_validate
(
table
+
st_rec
.
substitutionTable
,
table
+
st_rec
.
substitutionTable
,
table
+
st_rec
.
substitutionTable
+
st_rec
.
substitutionTable_length
,
table
+
st_rec
.
substitutionTable
+
st_rec
.
substitutionTable_length
,
valid
);
gx
valid
);
GXV_EXIT
;
GXV_EXIT
;
}
}
...
...
components/external/freetype/src/gxvalid/gxvmorx2.c
浏览文件 @
2fc33973
...
@@ -58,12 +58,12 @@
...
@@ -58,12 +58,12 @@
static
void
static
void
gxv_morx_subtable_type2_opttable_load
(
FT_Bytes
table
,
gxv_morx_subtable_type2_opttable_load
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
GXV_morx_subtable_type2_StateOptRecData
optdata
=
GXV_morx_subtable_type2_StateOptRecData
optdata
=
(
GXV_morx_subtable_type2_StateOptRecData
)
valid
->
xstatetable
.
optdata
;
(
GXV_morx_subtable_type2_StateOptRecData
)
gx
valid
->
xstatetable
.
optdata
;
GXV_LIMIT_CHECK
(
4
+
4
+
4
);
GXV_LIMIT_CHECK
(
4
+
4
+
4
);
...
@@ -88,14 +88,14 @@
...
@@ -88,14 +88,14 @@
FT_ULong
*
classTable_length_p
,
FT_ULong
*
classTable_length_p
,
FT_ULong
*
stateArray_length_p
,
FT_ULong
*
stateArray_length_p
,
FT_ULong
*
entryTable_length_p
,
FT_ULong
*
entryTable_length_p
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_ULong
o
[
6
];
FT_ULong
o
[
6
];
FT_ULong
*
l
[
6
];
FT_ULong
*
l
[
6
];
FT_ULong
buff
[
7
];
FT_ULong
buff
[
7
];
GXV_morx_subtable_type2_StateOptRecData
optdata
=
GXV_morx_subtable_type2_StateOptRecData
optdata
=
(
GXV_morx_subtable_type2_StateOptRecData
)
valid
->
xstatetable
.
optdata
;
(
GXV_morx_subtable_type2_StateOptRecData
)
gx
valid
->
xstatetable
.
optdata
;
GXV_NAME_ENTER
(
"subtable boundaries setup"
);
GXV_NAME_ENTER
(
"subtable boundaries setup"
);
...
@@ -113,7 +113,7 @@
...
@@ -113,7 +113,7 @@
l
[
4
]
=
&
(
optdata
->
componentTable_length
);
l
[
4
]
=
&
(
optdata
->
componentTable_length
);
l
[
5
]
=
&
(
optdata
->
ligatureTable_length
);
l
[
5
]
=
&
(
optdata
->
ligatureTable_length
);
gxv_set_length_by_ulong_offset
(
o
,
l
,
buff
,
6
,
table_size
,
valid
);
gxv_set_length_by_ulong_offset
(
o
,
l
,
buff
,
6
,
table_size
,
gx
valid
);
GXV_TRACE
((
"classTable: offset=0x%08x length=0x%08x
\n
"
,
GXV_TRACE
((
"classTable: offset=0x%08x length=0x%08x
\n
"
,
classTable
,
*
classTable_length_p
));
classTable
,
*
classTable_length_p
));
...
@@ -142,11 +142,11 @@
...
@@ -142,11 +142,11 @@
gxv_morx_subtable_type2_ligActionIndex_validate
(
gxv_morx_subtable_type2_ligActionIndex_validate
(
FT_Bytes
table
,
FT_Bytes
table
,
FT_UShort
ligActionIndex
,
FT_UShort
ligActionIndex
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
/* access ligActionTable */
/* access ligActionTable */
GXV_morx_subtable_type2_StateOptRecData
optdata
=
GXV_morx_subtable_type2_StateOptRecData
optdata
=
(
GXV_morx_subtable_type2_StateOptRecData
)
valid
->
xstatetable
.
optdata
;
(
GXV_morx_subtable_type2_StateOptRecData
)
gx
valid
->
xstatetable
.
optdata
;
FT_Bytes
lat_base
=
table
+
optdata
->
ligActionTable
;
FT_Bytes
lat_base
=
table
+
optdata
->
ligActionTable
;
FT_Bytes
p
=
lat_base
+
FT_Bytes
p
=
lat_base
+
...
@@ -188,7 +188,7 @@
...
@@ -188,7 +188,7 @@
/* it is different from the location offset in mort */
/* it is different from the location offset in mort */
if
(
(
offset
&
0x3FFF0000UL
)
==
0x3FFF0000UL
)
if
(
(
offset
&
0x3FFF0000UL
)
==
0x3FFF0000UL
)
{
/* negative offset */
{
/* negative offset */
gid_limit
=
valid
->
face
->
num_glyphs
-
(
offset
&
0x0000FFFFUL
);
gid_limit
=
gx
valid
->
face
->
num_glyphs
-
(
offset
&
0x0000FFFFUL
);
if
(
gid_limit
>
0
)
if
(
gid_limit
>
0
)
return
;
return
;
...
@@ -198,9 +198,9 @@
...
@@ -198,9 +198,9 @@
offset
&
0xFFFFU
));
offset
&
0xFFFFU
));
GXV_SET_ERR_IF_PARANOID
(
FT_INVALID_OFFSET
);
GXV_SET_ERR_IF_PARANOID
(
FT_INVALID_OFFSET
);
}
}
else
if
(
(
offset
&
0x3FFF0000UL
)
==
0x0000000UL
)
else
if
(
(
offset
&
0x3FFF0000UL
)
==
0x0000000
0
UL
)
{
/* positive offset */
{
/* positive offset */
if
(
(
FT_Long
)
offset
<
valid
->
face
->
num_glyphs
)
if
(
(
FT_Long
)
offset
<
gx
valid
->
face
->
num_glyphs
)
return
;
return
;
GXV_TRACE
((
"ligature action table includes"
GXV_TRACE
((
"ligature action table includes"
...
@@ -225,7 +225,7 @@
...
@@ -225,7 +225,7 @@
GXV_StateTable_GlyphOffsetCPtr
glyphOffset_p
,
GXV_StateTable_GlyphOffsetCPtr
glyphOffset_p
,
FT_Bytes
table
,
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
#ifdef GXV_LOAD_UNUSED_VARS
#ifdef GXV_LOAD_UNUSED_VARS
FT_UShort
setComponent
;
FT_UShort
setComponent
;
...
@@ -253,16 +253,16 @@
...
@@ -253,16 +253,16 @@
if
(
0
<
ligActionIndex
)
if
(
0
<
ligActionIndex
)
gxv_morx_subtable_type2_ligActionIndex_validate
(
gxv_morx_subtable_type2_ligActionIndex_validate
(
table
,
ligActionIndex
,
valid
);
table
,
ligActionIndex
,
gx
valid
);
}
}
static
void
static
void
gxv_morx_subtable_type2_ligatureTable_validate
(
FT_Bytes
table
,
gxv_morx_subtable_type2_ligatureTable_validate
(
FT_Bytes
table
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
GXV_morx_subtable_type2_StateOptRecData
optdata
=
GXV_morx_subtable_type2_StateOptRecData
optdata
=
(
GXV_morx_subtable_type2_StateOptRecData
)
valid
->
xstatetable
.
optdata
;
(
GXV_morx_subtable_type2_StateOptRecData
)
gx
valid
->
xstatetable
.
optdata
;
FT_Bytes
p
=
table
+
optdata
->
ligatureTable
;
FT_Bytes
p
=
table
+
optdata
->
ligatureTable
;
FT_Bytes
limit
=
table
+
optdata
->
ligatureTable
FT_Bytes
limit
=
table
+
optdata
->
ligatureTable
...
@@ -281,7 +281,7 @@
...
@@ -281,7 +281,7 @@
GXV_LIMIT_CHECK
(
2
);
GXV_LIMIT_CHECK
(
2
);
lig_gid
=
FT_NEXT_USHORT
(
p
);
lig_gid
=
FT_NEXT_USHORT
(
p
);
if
(
lig_gid
<
valid
->
face
->
num_glyphs
)
if
(
lig_gid
<
gx
valid
->
face
->
num_glyphs
)
GXV_SET_ERR_IF_PARANOID
(
FT_INVALID_GLYPH_ID
);
GXV_SET_ERR_IF_PARANOID
(
FT_INVALID_GLYPH_ID
);
}
}
}
}
...
@@ -293,7 +293,7 @@
...
@@ -293,7 +293,7 @@
FT_LOCAL_DEF
(
void
)
FT_LOCAL_DEF
(
void
)
gxv_morx_subtable_type2_validate
(
FT_Bytes
table
,
gxv_morx_subtable_type2_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
...
@@ -304,23 +304,23 @@
...
@@ -304,23 +304,23 @@
GXV_LIMIT_CHECK
(
GXV_MORX_SUBTABLE_TYPE2_HEADER_SIZE
);
GXV_LIMIT_CHECK
(
GXV_MORX_SUBTABLE_TYPE2_HEADER_SIZE
);
valid
->
xstatetable
.
optdata
=
gx
valid
->
xstatetable
.
optdata
=
&
lig_rec
;
&
lig_rec
;
valid
->
xstatetable
.
optdata_load_func
=
gx
valid
->
xstatetable
.
optdata_load_func
=
gxv_morx_subtable_type2_opttable_load
;
gxv_morx_subtable_type2_opttable_load
;
valid
->
xstatetable
.
subtable_setup_func
=
gx
valid
->
xstatetable
.
subtable_setup_func
=
gxv_morx_subtable_type2_subtable_setup
;
gxv_morx_subtable_type2_subtable_setup
;
valid
->
xstatetable
.
entry_glyphoffset_fmt
=
gx
valid
->
xstatetable
.
entry_glyphoffset_fmt
=
GXV_GLYPHOFFSET_USHORT
;
GXV_GLYPHOFFSET_USHORT
;
valid
->
xstatetable
.
entry_validate_func
=
gx
valid
->
xstatetable
.
entry_validate_func
=
gxv_morx_subtable_type2_entry_validate
;
gxv_morx_subtable_type2_entry_validate
;
gxv_XStateTable_validate
(
p
,
limit
,
valid
);
gxv_XStateTable_validate
(
p
,
limit
,
gx
valid
);
#if 0
#if 0
p += valid->subtable_length;
p +=
gx
valid->subtable_length;
#endif
#endif
gxv_morx_subtable_type2_ligatureTable_validate
(
table
,
valid
);
gxv_morx_subtable_type2_ligatureTable_validate
(
table
,
gx
valid
);
GXV_EXIT
;
GXV_EXIT
;
}
}
...
...
components/external/freetype/src/gxvalid/gxvmorx4.c
浏览文件 @
2fc33973
...
@@ -41,12 +41,12 @@
...
@@ -41,12 +41,12 @@
FT_LOCAL_DEF
(
void
)
FT_LOCAL_DEF
(
void
)
gxv_morx_subtable_type4_validate
(
FT_Bytes
table
,
gxv_morx_subtable_type4_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
GXV_NAME_ENTER
(
"morx chain subtable type4 "
GXV_NAME_ENTER
(
"morx chain subtable type4 "
"(Non-Contextual Glyph Substitution)"
);
"(Non-Contextual Glyph Substitution)"
);
gxv_mort_subtable_type4_validate
(
table
,
limit
,
valid
);
gxv_mort_subtable_type4_validate
(
table
,
limit
,
gx
valid
);
GXV_EXIT
;
GXV_EXIT
;
}
}
...
...
components/external/freetype/src/gxvalid/gxvmorx5.c
浏览文件 @
2fc33973
...
@@ -64,12 +64,12 @@
...
@@ -64,12 +64,12 @@
static
void
static
void
gxv_morx_subtable_type5_insertionGlyphList_load
(
FT_Bytes
table
,
gxv_morx_subtable_type5_insertionGlyphList_load
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
GXV_morx_subtable_type5_StateOptRecData
optdata
=
GXV_morx_subtable_type5_StateOptRecData
optdata
=
(
GXV_morx_subtable_type5_StateOptRecData
)
valid
->
xstatetable
.
optdata
;
(
GXV_morx_subtable_type5_StateOptRecData
)
gx
valid
->
xstatetable
.
optdata
;
GXV_LIMIT_CHECK
(
4
);
GXV_LIMIT_CHECK
(
4
);
...
@@ -85,14 +85,14 @@
...
@@ -85,14 +85,14 @@
FT_ULong
*
classTable_length_p
,
FT_ULong
*
classTable_length_p
,
FT_ULong
*
stateArray_length_p
,
FT_ULong
*
stateArray_length_p
,
FT_ULong
*
entryTable_length_p
,
FT_ULong
*
entryTable_length_p
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_ULong
o
[
4
];
FT_ULong
o
[
4
];
FT_ULong
*
l
[
4
];
FT_ULong
*
l
[
4
];
FT_ULong
buff
[
5
];
FT_ULong
buff
[
5
];
GXV_morx_subtable_type5_StateOptRecData
optdata
=
GXV_morx_subtable_type5_StateOptRecData
optdata
=
(
GXV_morx_subtable_type5_StateOptRecData
)
valid
->
xstatetable
.
optdata
;
(
GXV_morx_subtable_type5_StateOptRecData
)
gx
valid
->
xstatetable
.
optdata
;
o
[
0
]
=
classTable
;
o
[
0
]
=
classTable
;
...
@@ -104,7 +104,7 @@
...
@@ -104,7 +104,7 @@
l
[
2
]
=
entryTable_length_p
;
l
[
2
]
=
entryTable_length_p
;
l
[
3
]
=
&
(
optdata
->
insertionGlyphList_length
);
l
[
3
]
=
&
(
optdata
->
insertionGlyphList_length
);
gxv_set_length_by_ulong_offset
(
o
,
l
,
buff
,
4
,
table_size
,
valid
);
gxv_set_length_by_ulong_offset
(
o
,
l
,
buff
,
4
,
table_size
,
gx
valid
);
}
}
...
@@ -113,9 +113,9 @@
...
@@ -113,9 +113,9 @@
FT_UShort
count
,
FT_UShort
count
,
FT_Bytes
table
,
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
table
+
table_index
*
2
;
FT_Bytes
p
=
table
+
table_index
*
2
;
#ifndef GXV_LOAD_TRACE_VARS
#ifndef GXV_LOAD_TRACE_VARS
...
@@ -143,7 +143,7 @@
...
@@ -143,7 +143,7 @@
GXV_StateTable_GlyphOffsetCPtr
glyphOffset_p
,
GXV_StateTable_GlyphOffsetCPtr
glyphOffset_p
,
FT_Bytes
table
,
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
#ifdef GXV_LOAD_UNUSED_VARS
#ifdef GXV_LOAD_UNUSED_VARS
FT_Bool
setMark
;
FT_Bool
setMark
;
...
@@ -180,20 +180,20 @@
...
@@ -180,20 +180,20 @@
gxv_morx_subtable_type5_InsertList_validate
(
currentInsertList
,
gxv_morx_subtable_type5_InsertList_validate
(
currentInsertList
,
currentInsertCount
,
currentInsertCount
,
table
,
limit
,
table
,
limit
,
valid
);
gx
valid
);
if
(
markedInsertList
&&
0
!=
markedInsertCount
)
if
(
markedInsertList
&&
0
!=
markedInsertCount
)
gxv_morx_subtable_type5_InsertList_validate
(
markedInsertList
,
gxv_morx_subtable_type5_InsertList_validate
(
markedInsertList
,
markedInsertCount
,
markedInsertCount
,
table
,
limit
,
table
,
limit
,
valid
);
gx
valid
);
}
}
FT_LOCAL_DEF
(
void
)
FT_LOCAL_DEF
(
void
)
gxv_morx_subtable_type5_validate
(
FT_Bytes
table
,
gxv_morx_subtable_type5_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
...
@@ -205,18 +205,18 @@
...
@@ -205,18 +205,18 @@
GXV_LIMIT_CHECK
(
GXV_MORX_SUBTABLE_TYPE5_HEADER_SIZE
);
GXV_LIMIT_CHECK
(
GXV_MORX_SUBTABLE_TYPE5_HEADER_SIZE
);
valid
->
xstatetable
.
optdata
=
gx
valid
->
xstatetable
.
optdata
=
et
;
et
;
valid
->
xstatetable
.
optdata_load_func
=
gx
valid
->
xstatetable
.
optdata_load_func
=
gxv_morx_subtable_type5_insertionGlyphList_load
;
gxv_morx_subtable_type5_insertionGlyphList_load
;
valid
->
xstatetable
.
subtable_setup_func
=
gx
valid
->
xstatetable
.
subtable_setup_func
=
gxv_morx_subtable_type5_subtable_setup
;
gxv_morx_subtable_type5_subtable_setup
;
valid
->
xstatetable
.
entry_glyphoffset_fmt
=
gx
valid
->
xstatetable
.
entry_glyphoffset_fmt
=
GXV_GLYPHOFFSET_ULONG
;
GXV_GLYPHOFFSET_ULONG
;
valid
->
xstatetable
.
entry_validate_func
=
gx
valid
->
xstatetable
.
entry_validate_func
=
gxv_morx_subtable_type5_entry_validate
;
gxv_morx_subtable_type5_entry_validate
;
gxv_XStateTable_validate
(
p
,
limit
,
valid
);
gxv_XStateTable_validate
(
p
,
limit
,
gx
valid
);
GXV_EXIT
;
GXV_EXIT
;
}
}
...
...
components/external/freetype/src/gxvalid/gxvopbd.c
浏览文件 @
2fc33973
...
@@ -68,11 +68,11 @@
...
@@ -68,11 +68,11 @@
static
void
static
void
gxv_opbd_LookupValue_validate
(
FT_UShort
glyph
,
gxv_opbd_LookupValue_validate
(
FT_UShort
glyph
,
GXV_LookupValueCPtr
value_p
,
GXV_LookupValueCPtr
value_p
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
/* offset in LookupTable is measured from the head of opbd table */
/* offset in LookupTable is measured from the head of opbd table */
FT_Bytes
p
=
valid
->
root
->
base
+
value_p
->
u
;
FT_Bytes
p
=
gx
valid
->
root
->
base
+
value_p
->
u
;
FT_Bytes
limit
=
valid
->
root
->
limit
;
FT_Bytes
limit
=
gx
valid
->
root
->
limit
;
FT_Short
delta_value
;
FT_Short
delta_value
;
int
i
;
int
i
;
...
@@ -90,7 +90,7 @@
...
@@ -90,7 +90,7 @@
if
(
delta_value
==
-
1
)
if
(
delta_value
==
-
1
)
continue
;
continue
;
gxv_ctlPoint_validate
(
glyph
,
delta_value
,
valid
);
gxv_ctlPoint_validate
(
glyph
,
delta_value
,
gx
valid
);
}
}
else
/* format 0, value is distance */
else
/* format 0, value is distance */
continue
;
continue
;
...
@@ -134,12 +134,12 @@
...
@@ -134,12 +134,12 @@
gxv_opbd_LookupFmt4_transit
(
FT_UShort
relative_gindex
,
gxv_opbd_LookupFmt4_transit
(
FT_UShort
relative_gindex
,
GXV_LookupValueCPtr
base_value_p
,
GXV_LookupValueCPtr
base_value_p
,
FT_Bytes
lookuptbl_limit
,
FT_Bytes
lookuptbl_limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
GXV_LookupValueDesc
value
;
GXV_LookupValueDesc
value
;
FT_UNUSED
(
lookuptbl_limit
);
FT_UNUSED
(
lookuptbl_limit
);
FT_UNUSED
(
valid
);
FT_UNUSED
(
gx
valid
);
/* XXX: check range? */
/* XXX: check range? */
value
.
u
=
(
FT_UShort
)(
base_value_p
->
u
+
value
.
u
=
(
FT_UShort
)(
base_value_p
->
u
+
...
@@ -162,8 +162,8 @@
...
@@ -162,8 +162,8 @@
FT_Face
face
,
FT_Face
face
,
FT_Validator
ftvalid
)
FT_Validator
ftvalid
)
{
{
GXV_ValidatorRec
validrec
;
GXV_ValidatorRec
gx
validrec
;
GXV_Validator
valid
=
&
validrec
;
GXV_Validator
gxvalid
=
&
gx
validrec
;
GXV_opbd_DataRec
opbdrec
;
GXV_opbd_DataRec
opbdrec
;
GXV_opbd_Data
opbd
=
&
opbdrec
;
GXV_opbd_Data
opbd
=
&
opbdrec
;
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
...
@@ -172,9 +172,9 @@
...
@@ -172,9 +172,9 @@
FT_ULong
version
;
FT_ULong
version
;
valid
->
root
=
ftvalid
;
gx
valid
->
root
=
ftvalid
;
valid
->
table_data
=
opbd
;
gx
valid
->
table_data
=
opbd
;
valid
->
face
=
face
;
gx
valid
->
face
=
face
;
FT_TRACE3
((
"validating `opbd' table
\n
"
));
FT_TRACE3
((
"validating `opbd' table
\n
"
));
GXV_INIT
;
GXV_INIT
;
...
@@ -196,12 +196,12 @@
...
@@ -196,12 +196,12 @@
if
(
0x0001
<
GXV_OPBD_DATA
(
format
)
)
if
(
0x0001
<
GXV_OPBD_DATA
(
format
)
)
FT_INVALID_FORMAT
;
FT_INVALID_FORMAT
;
valid
->
lookupval_sign
=
GXV_LOOKUPVALUE_UNSIGNED
;
gx
valid
->
lookupval_sign
=
GXV_LOOKUPVALUE_UNSIGNED
;
valid
->
lookupval_func
=
gxv_opbd_LookupValue_validate
;
gx
valid
->
lookupval_func
=
gxv_opbd_LookupValue_validate
;
valid
->
lookupfmt4_trans
=
gxv_opbd_LookupFmt4_transit
;
gx
valid
->
lookupfmt4_trans
=
gxv_opbd_LookupFmt4_transit
;
gxv_LookupTable_validate
(
p
,
limit
,
valid
);
gxv_LookupTable_validate
(
p
,
limit
,
gx
valid
);
p
+=
valid
->
subtable_length
;
p
+=
gx
valid
->
subtable_length
;
if
(
p
>
table
+
GXV_OPBD_DATA
(
valueOffset_min
)
)
if
(
p
>
table
+
GXV_OPBD_DATA
(
valueOffset_min
)
)
{
{
...
...
components/external/freetype/src/gxvalid/gxvprop.c
浏览文件 @
2fc33973
...
@@ -75,7 +75,7 @@
...
@@ -75,7 +75,7 @@
static
void
static
void
gxv_prop_zero_advance_validate
(
FT_UShort
gid
,
gxv_prop_zero_advance_validate
(
FT_UShort
gid
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Face
face
;
FT_Face
face
;
FT_Error
error
;
FT_Error
error
;
...
@@ -84,7 +84,7 @@
...
@@ -84,7 +84,7 @@
GXV_NAME_ENTER
(
"zero advance"
);
GXV_NAME_ENTER
(
"zero advance"
);
face
=
valid
->
face
;
face
=
gx
valid
->
face
;
error
=
FT_Load_Glyph
(
face
,
error
=
FT_Load_Glyph
(
face
,
gid
,
gid
,
...
@@ -109,10 +109,10 @@
...
@@ -109,10 +109,10 @@
static
void
static
void
gxv_prop_property_validate
(
FT_UShort
property
,
gxv_prop_property_validate
(
FT_UShort
property
,
FT_UShort
glyph
,
FT_UShort
glyph
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
if
(
glyph
!=
0
&&
(
property
&
GXV_PROP_FLOATER
)
)
if
(
glyph
!=
0
&&
(
property
&
GXV_PROP_FLOATER
)
)
gxv_prop_zero_advance_validate
(
glyph
,
valid
);
gxv_prop_zero_advance_validate
(
glyph
,
gx
valid
);
if
(
property
&
GXV_PROP_USE_COMPLEMENTARY_BRACKET
)
if
(
property
&
GXV_PROP_USE_COMPLEMENTARY_BRACKET
)
{
{
...
@@ -145,7 +145,7 @@
...
@@ -145,7 +145,7 @@
else
else
{
{
/* The gid for complement must be the face. */
/* The gid for complement must be the face. */
gxv_glyphid_validate
(
(
FT_UShort
)(
glyph
+
complement
),
valid
);
gxv_glyphid_validate
(
(
FT_UShort
)(
glyph
+
complement
),
gx
valid
);
}
}
}
}
else
else
...
@@ -187,9 +187,9 @@
...
@@ -187,9 +187,9 @@
static
void
static
void
gxv_prop_LookupValue_validate
(
FT_UShort
glyph
,
gxv_prop_LookupValue_validate
(
FT_UShort
glyph
,
GXV_LookupValueCPtr
value_p
,
GXV_LookupValueCPtr
value_p
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
gxv_prop_property_validate
(
value_p
->
u
,
glyph
,
valid
);
gxv_prop_property_validate
(
value_p
->
u
,
glyph
,
gx
valid
);
}
}
...
@@ -224,7 +224,7 @@
...
@@ -224,7 +224,7 @@
gxv_prop_LookupFmt4_transit
(
FT_UShort
relative_gindex
,
gxv_prop_LookupFmt4_transit
(
FT_UShort
relative_gindex
,
GXV_LookupValueCPtr
base_value_p
,
GXV_LookupValueCPtr
base_value_p
,
FT_Bytes
lookuptbl_limit
,
FT_Bytes
lookuptbl_limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
;
FT_Bytes
p
;
FT_Bytes
limit
;
FT_Bytes
limit
;
...
@@ -234,7 +234,7 @@
...
@@ -234,7 +234,7 @@
/* XXX: check range? */
/* XXX: check range? */
offset
=
(
FT_UShort
)(
base_value_p
->
u
+
offset
=
(
FT_UShort
)(
base_value_p
->
u
+
relative_gindex
*
sizeof
(
FT_UShort
)
);
relative_gindex
*
sizeof
(
FT_UShort
)
);
p
=
valid
->
lookuptbl_head
+
offset
;
p
=
gx
valid
->
lookuptbl_head
+
offset
;
limit
=
lookuptbl_limit
;
limit
=
lookuptbl_limit
;
GXV_LIMIT_CHECK
(
2
);
GXV_LIMIT_CHECK
(
2
);
...
@@ -259,8 +259,8 @@
...
@@ -259,8 +259,8 @@
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
FT_Bytes
limit
=
0
;
FT_Bytes
limit
=
0
;
GXV_ValidatorRec
validrec
;
GXV_ValidatorRec
gx
validrec
;
GXV_Validator
valid
=
&
validrec
;
GXV_Validator
gxvalid
=
&
gx
validrec
;
GXV_prop_DataRec
proprec
;
GXV_prop_DataRec
proprec
;
GXV_prop_Data
prop
=
&
proprec
;
GXV_prop_Data
prop
=
&
proprec
;
...
@@ -270,9 +270,9 @@
...
@@ -270,9 +270,9 @@
FT_UShort
defaultProp
;
FT_UShort
defaultProp
;
valid
->
root
=
ftvalid
;
gx
valid
->
root
=
ftvalid
;
valid
->
table_data
=
prop
;
gx
valid
->
table_data
=
prop
;
valid
->
face
=
face
;
gx
valid
->
face
=
face
;
FT_TRACE3
((
"validating `prop' table
\n
"
));
FT_TRACE3
((
"validating `prop' table
\n
"
));
GXV_INIT
;
GXV_INIT
;
...
@@ -303,7 +303,7 @@
...
@@ -303,7 +303,7 @@
FT_INVALID_FORMAT
;
FT_INVALID_FORMAT
;
}
}
gxv_prop_property_validate
(
defaultProp
,
0
,
valid
);
gxv_prop_property_validate
(
defaultProp
,
0
,
gx
valid
);
if
(
format
==
0
)
if
(
format
==
0
)
{
{
...
@@ -315,11 +315,11 @@
...
@@ -315,11 +315,11 @@
/* format == 1 */
/* format == 1 */
GXV_PROP_DATA
(
version
)
=
version
;
GXV_PROP_DATA
(
version
)
=
version
;
valid
->
lookupval_sign
=
GXV_LOOKUPVALUE_UNSIGNED
;
gx
valid
->
lookupval_sign
=
GXV_LOOKUPVALUE_UNSIGNED
;
valid
->
lookupval_func
=
gxv_prop_LookupValue_validate
;
gx
valid
->
lookupval_func
=
gxv_prop_LookupValue_validate
;
valid
->
lookupfmt4_trans
=
gxv_prop_LookupFmt4_transit
;
gx
valid
->
lookupfmt4_trans
=
gxv_prop_LookupFmt4_transit
;
gxv_LookupTable_validate
(
p
,
limit
,
valid
);
gxv_LookupTable_validate
(
p
,
limit
,
gx
valid
);
Exit:
Exit:
FT_TRACE4
((
"
\n
"
));
FT_TRACE4
((
"
\n
"
));
...
...
components/external/freetype/src/gxvalid/gxvtrak.c
浏览文件 @
2fc33973
...
@@ -93,9 +93,9 @@
...
@@ -93,9 +93,9 @@
gxv_trak_trackTable_validate
(
FT_Bytes
table
,
gxv_trak_trackTable_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
FT_UShort
nTracks
,
FT_UShort
nTracks
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
FT_Fixed
track
,
t
;
FT_Fixed
track
,
t
;
FT_UShort
nameIndex
;
FT_UShort
nameIndex
;
...
@@ -122,7 +122,7 @@
...
@@ -122,7 +122,7 @@
if
(
offset
>
GXV_TRAK_DATA
(
trackValueOffset_max
)
)
if
(
offset
>
GXV_TRAK_DATA
(
trackValueOffset_max
)
)
GXV_TRAK_DATA
(
trackValueOffset_max
)
=
offset
;
GXV_TRAK_DATA
(
trackValueOffset_max
)
=
offset
;
gxv_sfntName_validate
(
nameIndex
,
256
,
32767
,
valid
);
gxv_sfntName_validate
(
nameIndex
,
256
,
32767
,
gx
valid
);
for
(
j
=
i
;
j
<
nTracks
;
j
++
)
for
(
j
=
i
;
j
<
nTracks
;
j
++
)
{
{
...
@@ -134,7 +134,7 @@
...
@@ -134,7 +134,7 @@
}
}
}
}
valid
->
subtable_length
=
p
-
table
;
gx
valid
->
subtable_length
=
p
-
table
;
GXV_EXIT
;
GXV_EXIT
;
}
}
...
@@ -142,7 +142,7 @@
...
@@ -142,7 +142,7 @@
static
void
static
void
gxv_trak_trackData_validate
(
FT_Bytes
table
,
gxv_trak_trackData_validate
(
FT_Bytes
table
,
FT_Bytes
limit
,
FT_Bytes
limit
,
GXV_Validator
valid
)
GXV_Validator
gx
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
FT_UShort
nTracks
;
FT_UShort
nTracks
;
...
@@ -164,31 +164,31 @@
...
@@ -164,31 +164,31 @@
gxv_odtect_add_range
(
table
,
p
-
table
,
"trackData header"
,
odtect
);
gxv_odtect_add_range
(
table
,
p
-
table
,
"trackData header"
,
odtect
);
/* validate trackTable */
/* validate trackTable */
gxv_trak_trackTable_validate
(
p
,
limit
,
nTracks
,
valid
);
gxv_trak_trackTable_validate
(
p
,
limit
,
nTracks
,
gx
valid
);
gxv_odtect_add_range
(
p
,
valid
->
subtable_length
,
gxv_odtect_add_range
(
p
,
gx
valid
->
subtable_length
,
"trackTable"
,
odtect
);
"trackTable"
,
odtect
);
/* sizeTable is array of FT_Fixed, don't check contents */
/* sizeTable is array of FT_Fixed, don't check contents */
p
=
valid
->
root
->
base
+
sizeTableOffset
;
p
=
gx
valid
->
root
->
base
+
sizeTableOffset
;
GXV_LIMIT_CHECK
(
nSizes
*
4
);
GXV_LIMIT_CHECK
(
nSizes
*
4
);
gxv_odtect_add_range
(
p
,
nSizes
*
4
,
"sizeTable"
,
odtect
);
gxv_odtect_add_range
(
p
,
nSizes
*
4
,
"sizeTable"
,
odtect
);
/* validate trackValueOffet */
/* validate trackValueOffet */
p
=
valid
->
root
->
base
+
GXV_TRAK_DATA
(
trackValueOffset_min
);
p
=
gx
valid
->
root
->
base
+
GXV_TRAK_DATA
(
trackValueOffset_min
);
if
(
limit
-
p
<
nTracks
*
nSizes
*
2
)
if
(
limit
-
p
<
nTracks
*
nSizes
*
2
)
GXV_TRACE
((
"too short trackValue array
\n
"
));
GXV_TRACE
((
"too short trackValue array
\n
"
));
p
=
valid
->
root
->
base
+
GXV_TRAK_DATA
(
trackValueOffset_max
);
p
=
gx
valid
->
root
->
base
+
GXV_TRAK_DATA
(
trackValueOffset_max
);
GXV_LIMIT_CHECK
(
nSizes
*
2
);
GXV_LIMIT_CHECK
(
nSizes
*
2
);
gxv_odtect_add_range
(
valid
->
root
->
base
gxv_odtect_add_range
(
gx
valid
->
root
->
base
+
GXV_TRAK_DATA
(
trackValueOffset_min
),
+
GXV_TRAK_DATA
(
trackValueOffset_min
),
GXV_TRAK_DATA
(
trackValueOffset_max
)
GXV_TRAK_DATA
(
trackValueOffset_max
)
-
GXV_TRAK_DATA
(
trackValueOffset_min
)
-
GXV_TRAK_DATA
(
trackValueOffset_min
)
+
nSizes
*
2
,
+
nSizes
*
2
,
"trackValue array"
,
odtect
);
"trackValue array"
,
odtect
);
gxv_odtect_validate
(
odtect
,
valid
);
gxv_odtect_validate
(
odtect
,
gx
valid
);
GXV_EXIT
;
GXV_EXIT
;
}
}
...
@@ -210,8 +210,8 @@
...
@@ -210,8 +210,8 @@
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
FT_Bytes
limit
=
0
;
FT_Bytes
limit
=
0
;
GXV_ValidatorRec
validrec
;
GXV_ValidatorRec
gx
validrec
;
GXV_Validator
valid
=
&
validrec
;
GXV_Validator
gxvalid
=
&
gx
validrec
;
GXV_trak_DataRec
trakrec
;
GXV_trak_DataRec
trakrec
;
GXV_trak_Data
trak
=
&
trakrec
;
GXV_trak_Data
trak
=
&
trakrec
;
...
@@ -225,11 +225,11 @@
...
@@ -225,11 +225,11 @@
GXV_ODTECT
(
3
,
odtect
);
GXV_ODTECT
(
3
,
odtect
);
GXV_ODTECT_INIT
(
odtect
);
GXV_ODTECT_INIT
(
odtect
);
valid
->
root
=
ftvalid
;
gx
valid
->
root
=
ftvalid
;
valid
->
table_data
=
trak
;
gx
valid
->
table_data
=
trak
;
valid
->
face
=
face
;
gx
valid
->
face
=
face
;
limit
=
valid
->
root
->
limit
;
limit
=
gx
valid
->
root
->
limit
;
FT_TRACE3
((
"validating `trak' table
\n
"
));
FT_TRACE3
((
"validating `trak' table
\n
"
));
GXV_INIT
;
GXV_INIT
;
...
@@ -265,19 +265,19 @@
...
@@ -265,19 +265,19 @@
/* validate trackData */
/* validate trackData */
if
(
0
<
horizOffset
)
if
(
0
<
horizOffset
)
{
{
gxv_trak_trackData_validate
(
table
+
horizOffset
,
limit
,
valid
);
gxv_trak_trackData_validate
(
table
+
horizOffset
,
limit
,
gx
valid
);
gxv_odtect_add_range
(
table
+
horizOffset
,
valid
->
subtable_length
,
gxv_odtect_add_range
(
table
+
horizOffset
,
gx
valid
->
subtable_length
,
"horizJustData"
,
odtect
);
"horizJustData"
,
odtect
);
}
}
if
(
0
<
vertOffset
)
if
(
0
<
vertOffset
)
{
{
gxv_trak_trackData_validate
(
table
+
vertOffset
,
limit
,
valid
);
gxv_trak_trackData_validate
(
table
+
vertOffset
,
limit
,
gx
valid
);
gxv_odtect_add_range
(
table
+
vertOffset
,
valid
->
subtable_length
,
gxv_odtect_add_range
(
table
+
vertOffset
,
gx
valid
->
subtable_length
,
"vertJustData"
,
odtect
);
"vertJustData"
,
odtect
);
}
}
gxv_odtect_validate
(
odtect
,
valid
);
gxv_odtect_validate
(
odtect
,
gx
valid
);
FT_TRACE4
((
"
\n
"
));
FT_TRACE4
((
"
\n
"
));
}
}
...
...
components/external/freetype/src/gzip/ftgzip.c
浏览文件 @
2fc33973
...
@@ -208,8 +208,8 @@
...
@@ -208,8 +208,8 @@
/* head[0] && head[1] are the magic numbers; */
/* head[0] && head[1] are the magic numbers; */
/* head[2] is the method, and head[3] the flags */
/* head[2] is the method, and head[3] the flags */
if
(
head
[
0
]
!=
0x1
f
||
if
(
head
[
0
]
!=
0x1
F
||
head
[
1
]
!=
0x8
b
||
head
[
1
]
!=
0x8
B
||
head
[
2
]
!=
Z_DEFLATED
||
head
[
2
]
!=
Z_DEFLATED
||
(
head
[
3
]
&
FT_GZIP_RESERVED
)
)
(
head
[
3
]
&
FT_GZIP_RESERVED
)
)
{
{
...
...
components/external/freetype/src/lzw/ftlzw.c
浏览文件 @
2fc33973
...
@@ -96,8 +96,8 @@
...
@@ -96,8 +96,8 @@
goto
Exit
;
goto
Exit
;
/* head[0] && head[1] are the magic numbers */
/* head[0] && head[1] are the magic numbers */
if
(
head
[
0
]
!=
0x1
f
||
if
(
head
[
0
]
!=
0x1
F
||
head
[
1
]
!=
0x9
d
)
head
[
1
]
!=
0x9
D
)
error
=
FT_THROW
(
Invalid_File_Format
);
error
=
FT_THROW
(
Invalid_File_Format
);
Exit:
Exit:
...
...
components/external/freetype/src/lzw/ftzopen.h
浏览文件 @
2fc33973
...
@@ -41,7 +41,7 @@
...
@@ -41,7 +41,7 @@
#define LZW_CLEAR 256
#define LZW_CLEAR 256
#define LZW_FIRST 257
#define LZW_FIRST 257
#define LZW_BIT_MASK 0x1
f
#define LZW_BIT_MASK 0x1
F
#define LZW_BLOCK_MASK 0x80
#define LZW_BLOCK_MASK 0x80
#define LZW_MASK( n ) ( ( 1U << (n) ) - 1U )
#define LZW_MASK( n ) ( ( 1U << (n) ) - 1U )
...
...
components/external/freetype/src/otvalid/otvbase.c
浏览文件 @
2fc33973
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
static
void
static
void
otv_BaseCoord_validate
(
FT_Bytes
table
,
otv_BaseCoord_validate
(
FT_Bytes
table
,
OTV_Validator
valid
)
OTV_Validator
ot
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
FT_UInt
BaseCoordFormat
;
FT_UInt
BaseCoordFormat
;
...
@@ -58,7 +58,7 @@
...
@@ -58,7 +58,7 @@
case
3
:
/* BaseCoordFormat3 */
case
3
:
/* BaseCoordFormat3 */
OTV_LIMIT_CHECK
(
2
);
OTV_LIMIT_CHECK
(
2
);
/* DeviceTable */
/* DeviceTable */
otv_Device_validate
(
table
+
FT_NEXT_USHORT
(
p
),
valid
);
otv_Device_validate
(
table
+
FT_NEXT_USHORT
(
p
),
ot
valid
);
break
;
break
;
default:
default:
...
@@ -71,7 +71,7 @@
...
@@ -71,7 +71,7 @@
static
void
static
void
otv_BaseTagList_validate
(
FT_Bytes
table
,
otv_BaseTagList_validate
(
FT_Bytes
table
,
OTV_Validator
valid
)
OTV_Validator
ot
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
FT_UInt
BaseTagCount
;
FT_UInt
BaseTagCount
;
...
@@ -93,7 +93,7 @@
...
@@ -93,7 +93,7 @@
static
void
static
void
otv_BaseValues_validate
(
FT_Bytes
table
,
otv_BaseValues_validate
(
FT_Bytes
table
,
OTV_Validator
valid
)
OTV_Validator
ot
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
FT_UInt
BaseCoordCount
;
FT_UInt
BaseCoordCount
;
...
@@ -112,7 +112,7 @@
...
@@ -112,7 +112,7 @@
/* BaseCoord */
/* BaseCoord */
for
(
;
BaseCoordCount
>
0
;
BaseCoordCount
--
)
for
(
;
BaseCoordCount
>
0
;
BaseCoordCount
--
)
otv_BaseCoord_validate
(
table
+
FT_NEXT_USHORT
(
p
),
valid
);
otv_BaseCoord_validate
(
table
+
FT_NEXT_USHORT
(
p
),
ot
valid
);
OTV_EXIT
;
OTV_EXIT
;
}
}
...
@@ -120,7 +120,7 @@
...
@@ -120,7 +120,7 @@
static
void
static
void
otv_MinMax_validate
(
FT_Bytes
table
,
otv_MinMax_validate
(
FT_Bytes
table
,
OTV_Validator
valid
)
OTV_Validator
ot
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
FT_UInt
table_size
;
FT_UInt
table_size
;
...
@@ -144,11 +144,11 @@
...
@@ -144,11 +144,11 @@
OTV_SIZE_CHECK
(
MinCoord
);
OTV_SIZE_CHECK
(
MinCoord
);
if
(
MinCoord
)
if
(
MinCoord
)
otv_BaseCoord_validate
(
table
+
MinCoord
,
valid
);
otv_BaseCoord_validate
(
table
+
MinCoord
,
ot
valid
);
OTV_SIZE_CHECK
(
MaxCoord
);
OTV_SIZE_CHECK
(
MaxCoord
);
if
(
MaxCoord
)
if
(
MaxCoord
)
otv_BaseCoord_validate
(
table
+
MaxCoord
,
valid
);
otv_BaseCoord_validate
(
table
+
MaxCoord
,
ot
valid
);
OTV_LIMIT_CHECK
(
FeatMinMaxCount
*
8
);
OTV_LIMIT_CHECK
(
FeatMinMaxCount
*
8
);
...
@@ -162,11 +162,11 @@
...
@@ -162,11 +162,11 @@
OTV_SIZE_CHECK
(
MinCoord
);
OTV_SIZE_CHECK
(
MinCoord
);
if
(
MinCoord
)
if
(
MinCoord
)
otv_BaseCoord_validate
(
table
+
MinCoord
,
valid
);
otv_BaseCoord_validate
(
table
+
MinCoord
,
ot
valid
);
OTV_SIZE_CHECK
(
MaxCoord
);
OTV_SIZE_CHECK
(
MaxCoord
);
if
(
MaxCoord
)
if
(
MaxCoord
)
otv_BaseCoord_validate
(
table
+
MaxCoord
,
valid
);
otv_BaseCoord_validate
(
table
+
MaxCoord
,
ot
valid
);
}
}
OTV_EXIT
;
OTV_EXIT
;
...
@@ -175,7 +175,7 @@
...
@@ -175,7 +175,7 @@
static
void
static
void
otv_BaseScript_validate
(
FT_Bytes
table
,
otv_BaseScript_validate
(
FT_Bytes
table
,
OTV_Validator
valid
)
OTV_Validator
ot
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
FT_UInt
table_size
;
FT_UInt
table_size
;
...
@@ -198,11 +198,11 @@
...
@@ -198,11 +198,11 @@
OTV_SIZE_CHECK
(
BaseValues
);
OTV_SIZE_CHECK
(
BaseValues
);
if
(
BaseValues
)
if
(
BaseValues
)
otv_BaseValues_validate
(
table
+
BaseValues
,
valid
);
otv_BaseValues_validate
(
table
+
BaseValues
,
ot
valid
);
OTV_SIZE_CHECK
(
DefaultMinMax
);
OTV_SIZE_CHECK
(
DefaultMinMax
);
if
(
DefaultMinMax
)
if
(
DefaultMinMax
)
otv_MinMax_validate
(
table
+
DefaultMinMax
,
valid
);
otv_MinMax_validate
(
table
+
DefaultMinMax
,
ot
valid
);
OTV_LIMIT_CHECK
(
BaseLangSysCount
*
6
);
OTV_LIMIT_CHECK
(
BaseLangSysCount
*
6
);
...
@@ -211,7 +211,7 @@
...
@@ -211,7 +211,7 @@
{
{
p
+=
4
;
/* skip BaseLangSysTag */
p
+=
4
;
/* skip BaseLangSysTag */
otv_MinMax_validate
(
table
+
FT_NEXT_USHORT
(
p
),
valid
);
otv_MinMax_validate
(
table
+
FT_NEXT_USHORT
(
p
),
ot
valid
);
}
}
OTV_EXIT
;
OTV_EXIT
;
...
@@ -220,7 +220,7 @@
...
@@ -220,7 +220,7 @@
static
void
static
void
otv_BaseScriptList_validate
(
FT_Bytes
table
,
otv_BaseScriptList_validate
(
FT_Bytes
table
,
OTV_Validator
valid
)
OTV_Validator
ot
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
FT_UInt
BaseScriptCount
;
FT_UInt
BaseScriptCount
;
...
@@ -241,7 +241,7 @@
...
@@ -241,7 +241,7 @@
p
+=
4
;
/* skip BaseScriptTag */
p
+=
4
;
/* skip BaseScriptTag */
/* BaseScript */
/* BaseScript */
otv_BaseScript_validate
(
table
+
FT_NEXT_USHORT
(
p
),
valid
);
otv_BaseScript_validate
(
table
+
FT_NEXT_USHORT
(
p
),
ot
valid
);
}
}
OTV_EXIT
;
OTV_EXIT
;
...
@@ -250,7 +250,7 @@
...
@@ -250,7 +250,7 @@
static
void
static
void
otv_Axis_validate
(
FT_Bytes
table
,
otv_Axis_validate
(
FT_Bytes
table
,
OTV_Validator
valid
)
OTV_Validator
ot
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
FT_UInt
table_size
;
FT_UInt
table_size
;
...
@@ -267,10 +267,10 @@
...
@@ -267,10 +267,10 @@
OTV_SIZE_CHECK
(
BaseTagList
);
OTV_SIZE_CHECK
(
BaseTagList
);
if
(
BaseTagList
)
if
(
BaseTagList
)
otv_BaseTagList_validate
(
table
+
BaseTagList
,
valid
);
otv_BaseTagList_validate
(
table
+
BaseTagList
,
ot
valid
);
/* BaseScriptList */
/* BaseScriptList */
otv_BaseScriptList_validate
(
table
+
FT_NEXT_USHORT
(
p
),
valid
);
otv_BaseScriptList_validate
(
table
+
FT_NEXT_USHORT
(
p
),
ot
valid
);
OTV_EXIT
;
OTV_EXIT
;
}
}
...
@@ -280,16 +280,16 @@
...
@@ -280,16 +280,16 @@
otv_BASE_validate
(
FT_Bytes
table
,
otv_BASE_validate
(
FT_Bytes
table
,
FT_Validator
ftvalid
)
FT_Validator
ftvalid
)
{
{
OTV_ValidatorRec
validrec
;
OTV_ValidatorRec
ot
validrec
;
OTV_Validator
valid
=
&
validrec
;
OTV_Validator
otvalid
=
&
ot
validrec
;
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
FT_UInt
table_size
;
FT_UInt
table_size
;
OTV_OPTIONAL_TABLE
(
HorizAxis
);
OTV_OPTIONAL_TABLE
(
HorizAxis
);
OTV_OPTIONAL_TABLE
(
VertAxis
);
OTV_OPTIONAL_TABLE
(
VertAxis
);
valid
->
root
=
ftvalid
;
ot
valid
->
root
=
ftvalid
;
FT_TRACE3
((
"validating BASE table
\n
"
));
FT_TRACE3
((
"validating BASE table
\n
"
));
OTV_INIT
;
OTV_INIT
;
...
@@ -304,12 +304,12 @@
...
@@ -304,12 +304,12 @@
OTV_OPTIONAL_OFFSET
(
HorizAxis
);
OTV_OPTIONAL_OFFSET
(
HorizAxis
);
OTV_SIZE_CHECK
(
HorizAxis
);
OTV_SIZE_CHECK
(
HorizAxis
);
if
(
HorizAxis
)
if
(
HorizAxis
)
otv_Axis_validate
(
table
+
HorizAxis
,
valid
);
otv_Axis_validate
(
table
+
HorizAxis
,
ot
valid
);
OTV_OPTIONAL_OFFSET
(
VertAxis
);
OTV_OPTIONAL_OFFSET
(
VertAxis
);
OTV_SIZE_CHECK
(
VertAxis
);
OTV_SIZE_CHECK
(
VertAxis
);
if
(
VertAxis
)
if
(
VertAxis
)
otv_Axis_validate
(
table
+
VertAxis
,
valid
);
otv_Axis_validate
(
table
+
VertAxis
,
ot
valid
);
FT_TRACE4
((
"
\n
"
));
FT_TRACE4
((
"
\n
"
));
}
}
...
...
components/external/freetype/src/otvalid/otvcommn.c
浏览文件 @
2fc33973
此差异已折叠。
点击以展开。
components/external/freetype/src/otvalid/otvcommn.h
浏览文件 @
2fc33973
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
/* */
/* */
/* OpenType common tables validation (specification). */
/* OpenType common tables validation (specification). */
/* */
/* */
/* Copyright 2004, 2005, 2007, 2009
by
*/
/* Copyright 2004, 2005, 2007, 2009
, 2014 by
*/
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* This file is part of the FreeType project, and may only be used, */
...
@@ -39,7 +39,7 @@ FT_BEGIN_HEADER
...
@@ -39,7 +39,7 @@ FT_BEGIN_HEADER
typedef
struct
OTV_ValidatorRec_
*
OTV_Validator
;
typedef
struct
OTV_ValidatorRec_
*
OTV_Validator
;
typedef
void
(
*
OTV_Validate_Func
)(
FT_Bytes
table
,
typedef
void
(
*
OTV_Validate_Func
)(
FT_Bytes
table
,
OTV_Validator
valid
);
OTV_Validator
ot
valid
);
typedef
struct
OTV_ValidatorRec_
typedef
struct
OTV_ValidatorRec_
{
{
...
@@ -67,8 +67,8 @@ FT_BEGIN_HEADER
...
@@ -67,8 +67,8 @@ FT_BEGIN_HEADER
#undef FT_INVALID_
#undef FT_INVALID_
#define FT_INVALID_( _
prefix, _error )
\
#define FT_INVALID_( _
error )
\
ft_validator_error(
valid->root, _prefix ## _error
)
ft_validator_error(
otvalid->root, FT_THROW( _error )
)
#define OTV_OPTIONAL_TABLE( _table ) FT_UShort _table; \
#define OTV_OPTIONAL_TABLE( _table ) FT_UShort _table; \
FT_Bytes _table ## _p
FT_Bytes _table ## _p
...
@@ -81,7 +81,7 @@ FT_BEGIN_HEADER
...
@@ -81,7 +81,7 @@ FT_BEGIN_HEADER
#define OTV_LIMIT_CHECK( _count ) \
#define OTV_LIMIT_CHECK( _count ) \
FT_BEGIN_STMNT \
FT_BEGIN_STMNT \
if ( p + (_count) > valid->root->limit ) \
if ( p + (_count) >
ot
valid->root->limit ) \
FT_INVALID_TOO_SHORT; \
FT_INVALID_TOO_SHORT; \
FT_END_STMNT
FT_END_STMNT
...
@@ -89,7 +89,7 @@ FT_BEGIN_HEADER
...
@@ -89,7 +89,7 @@ FT_BEGIN_HEADER
FT_BEGIN_STMNT \
FT_BEGIN_STMNT \
if ( _size > 0 && _size < table_size ) \
if ( _size > 0 && _size < table_size ) \
{ \
{ \
if ( valid->root->level == FT_VALIDATE_PARANOID ) \
if (
ot
valid->root->level == FT_VALIDATE_PARANOID ) \
FT_INVALID_OFFSET; \
FT_INVALID_OFFSET; \
else \
else \
{ \
{ \
...
@@ -117,79 +117,79 @@ FT_BEGIN_HEADER
...
@@ -117,79 +117,79 @@ FT_BEGIN_HEADER
#ifdef FT_DEBUG_LEVEL_TRACE
#ifdef FT_DEBUG_LEVEL_TRACE
#define OTV_NEST1( x ) \
#define OTV_NEST1( x )
\
FT_BEGIN_STMNT \
FT_BEGIN_STMNT
\
valid->nesting_level = 0; \
ot
valid->nesting_level = 0; \
valid->func[0] = OTV_FUNC( x ); \
ot
valid->func[0] = OTV_FUNC( x ); \
valid->debug_function_name[0] = OTV_NAME( x ); \
ot
valid->debug_function_name[0] = OTV_NAME( x ); \
FT_END_STMNT
FT_END_STMNT
#define OTV_NEST2( x, y ) \
#define OTV_NEST2( x, y )
\
FT_BEGIN_STMNT \
FT_BEGIN_STMNT
\
valid->nesting_level = 0; \
ot
valid->nesting_level = 0; \
valid->func[0] = OTV_FUNC( x ); \
ot
valid->func[0] = OTV_FUNC( x ); \
valid->func[1] = OTV_FUNC( y ); \
ot
valid->func[1] = OTV_FUNC( y ); \
valid->debug_function_name[0] = OTV_NAME( x ); \
ot
valid->debug_function_name[0] = OTV_NAME( x ); \
valid->debug_function_name[1] = OTV_NAME( y ); \
ot
valid->debug_function_name[1] = OTV_NAME( y ); \
FT_END_STMNT
FT_END_STMNT
#define OTV_NEST3( x, y, z ) \
#define OTV_NEST3( x, y, z )
\
FT_BEGIN_STMNT \
FT_BEGIN_STMNT
\
valid->nesting_level = 0; \
ot
valid->nesting_level = 0; \
valid->func[0] = OTV_FUNC( x ); \
ot
valid->func[0] = OTV_FUNC( x ); \
valid->func[1] = OTV_FUNC( y ); \
ot
valid->func[1] = OTV_FUNC( y ); \
valid->func[2] = OTV_FUNC( z ); \
ot
valid->func[2] = OTV_FUNC( z ); \
valid->debug_function_name[0] = OTV_NAME( x ); \
ot
valid->debug_function_name[0] = OTV_NAME( x ); \
valid->debug_function_name[1] = OTV_NAME( y ); \
ot
valid->debug_function_name[1] = OTV_NAME( y ); \
valid->debug_function_name[2] = OTV_NAME( z ); \
ot
valid->debug_function_name[2] = OTV_NAME( z ); \
FT_END_STMNT
FT_END_STMNT
#define OTV_INIT valid->debug_indent = 0
#define OTV_INIT
ot
valid->debug_indent = 0
#define OTV_ENTER \
#define OTV_ENTER
\
FT_BEGIN_STMNT \
FT_BEGIN_STMNT
\
valid->debug_indent += 2; \
ot
valid->debug_indent += 2; \
FT_TRACE4(( "%*.s", valid->debug_indent, 0 )); \
FT_TRACE4(( "%*.s",
ot
valid->debug_indent, 0 )); \
FT_TRACE4(( "%s table\n", \
FT_TRACE4(( "%s table\n",
\
valid->debug_function_name[
valid->nesting_level] )); \
otvalid->debug_function_name[ot
valid->nesting_level] )); \
FT_END_STMNT
FT_END_STMNT
#define OTV_NAME_ENTER( name ) \
#define OTV_NAME_ENTER( name )
\
FT_BEGIN_STMNT \
FT_BEGIN_STMNT
\
valid->debug_indent += 2; \
ot
valid->debug_indent += 2; \
FT_TRACE4(( "%*.s", valid->debug_indent, 0 )); \
FT_TRACE4(( "%*.s",
ot
valid->debug_indent, 0 )); \
FT_TRACE4(( "%s table\n", name )); \
FT_TRACE4(( "%s table\n", name ));
\
FT_END_STMNT
FT_END_STMNT
#define OTV_EXIT valid->debug_indent -= 2
#define OTV_EXIT
ot
valid->debug_indent -= 2
#define OTV_TRACE( s ) \
#define OTV_TRACE( s )
\
FT_BEGIN_STMNT \
FT_BEGIN_STMNT
\
FT_TRACE4(( "%*.s", valid->debug_indent, 0 )); \
FT_TRACE4(( "%*.s",
ot
valid->debug_indent, 0 )); \
FT_TRACE4( s ); \
FT_TRACE4( s );
\
FT_END_STMNT
FT_END_STMNT
#else
/* !FT_DEBUG_LEVEL_TRACE */
#else
/* !FT_DEBUG_LEVEL_TRACE */
#define OTV_NEST1( x ) \
#define OTV_NEST1( x )
\
FT_BEGIN_STMNT \
FT_BEGIN_STMNT
\
valid->nesting_level = 0; \
ot
valid->nesting_level = 0; \
valid->func[0] = OTV_FUNC( x ); \
ot
valid->func[0] = OTV_FUNC( x ); \
FT_END_STMNT
FT_END_STMNT
#define OTV_NEST2( x, y ) \
#define OTV_NEST2( x, y )
\
FT_BEGIN_STMNT \
FT_BEGIN_STMNT
\
valid->nesting_level = 0; \
ot
valid->nesting_level = 0; \
valid->func[0] = OTV_FUNC( x ); \
ot
valid->func[0] = OTV_FUNC( x ); \
valid->func[1] = OTV_FUNC( y ); \
ot
valid->func[1] = OTV_FUNC( y ); \
FT_END_STMNT
FT_END_STMNT
#define OTV_NEST3( x, y, z ) \
#define OTV_NEST3( x, y, z )
\
FT_BEGIN_STMNT \
FT_BEGIN_STMNT
\
valid->nesting_level = 0; \
ot
valid->nesting_level = 0; \
valid->func[0] = OTV_FUNC( x ); \
ot
valid->func[0] = OTV_FUNC( x ); \
valid->func[1] = OTV_FUNC( y ); \
ot
valid->func[1] = OTV_FUNC( y ); \
valid->func[2] = OTV_FUNC( z ); \
ot
valid->func[2] = OTV_FUNC( z ); \
FT_END_STMNT
FT_END_STMNT
#define OTV_INIT do { } while ( 0 )
#define OTV_INIT do { } while ( 0 )
...
@@ -202,7 +202,7 @@ FT_BEGIN_HEADER
...
@@ -202,7 +202,7 @@ FT_BEGIN_HEADER
#endif
/* !FT_DEBUG_LEVEL_TRACE */
#endif
/* !FT_DEBUG_LEVEL_TRACE */
#define OTV_RUN valid->func[0]
#define OTV_RUN
ot
valid->func[0]
/*************************************************************************/
/*************************************************************************/
...
@@ -215,7 +215,7 @@ FT_BEGIN_HEADER
...
@@ -215,7 +215,7 @@ FT_BEGIN_HEADER
FT_LOCAL
(
void
)
FT_LOCAL
(
void
)
otv_Coverage_validate
(
FT_Bytes
table
,
otv_Coverage_validate
(
FT_Bytes
table
,
OTV_Validator
valid
,
OTV_Validator
ot
valid
,
FT_Int
expected_count
);
FT_Int
expected_count
);
/* return first covered glyph */
/* return first covered glyph */
...
@@ -241,7 +241,7 @@ FT_BEGIN_HEADER
...
@@ -241,7 +241,7 @@ FT_BEGIN_HEADER
FT_LOCAL
(
void
)
FT_LOCAL
(
void
)
otv_ClassDef_validate
(
FT_Bytes
table
,
otv_ClassDef_validate
(
FT_Bytes
table
,
OTV_Validator
valid
);
OTV_Validator
ot
valid
);
/*************************************************************************/
/*************************************************************************/
...
@@ -254,7 +254,7 @@ FT_BEGIN_HEADER
...
@@ -254,7 +254,7 @@ FT_BEGIN_HEADER
FT_LOCAL
(
void
)
FT_LOCAL
(
void
)
otv_Device_validate
(
FT_Bytes
table
,
otv_Device_validate
(
FT_Bytes
table
,
OTV_Validator
valid
);
OTV_Validator
ot
valid
);
/*************************************************************************/
/*************************************************************************/
...
@@ -267,11 +267,11 @@ FT_BEGIN_HEADER
...
@@ -267,11 +267,11 @@ FT_BEGIN_HEADER
FT_LOCAL
(
void
)
FT_LOCAL
(
void
)
otv_Lookup_validate
(
FT_Bytes
table
,
otv_Lookup_validate
(
FT_Bytes
table
,
OTV_Validator
valid
);
OTV_Validator
ot
valid
);
FT_LOCAL
(
void
)
FT_LOCAL
(
void
)
otv_LookupList_validate
(
FT_Bytes
table
,
otv_LookupList_validate
(
FT_Bytes
table
,
OTV_Validator
valid
);
OTV_Validator
ot
valid
);
/*************************************************************************/
/*************************************************************************/
...
@@ -284,13 +284,13 @@ FT_BEGIN_HEADER
...
@@ -284,13 +284,13 @@ FT_BEGIN_HEADER
FT_LOCAL
(
void
)
FT_LOCAL
(
void
)
otv_Feature_validate
(
FT_Bytes
table
,
otv_Feature_validate
(
FT_Bytes
table
,
OTV_Validator
valid
);
OTV_Validator
ot
valid
);
/* lookups must already be validated */
/* lookups must already be validated */
FT_LOCAL
(
void
)
FT_LOCAL
(
void
)
otv_FeatureList_validate
(
FT_Bytes
table
,
otv_FeatureList_validate
(
FT_Bytes
table
,
FT_Bytes
lookups
,
FT_Bytes
lookups
,
OTV_Validator
valid
);
OTV_Validator
ot
valid
);
/*************************************************************************/
/*************************************************************************/
...
@@ -303,7 +303,7 @@ FT_BEGIN_HEADER
...
@@ -303,7 +303,7 @@ FT_BEGIN_HEADER
FT_LOCAL
(
void
)
FT_LOCAL
(
void
)
otv_LangSys_validate
(
FT_Bytes
table
,
otv_LangSys_validate
(
FT_Bytes
table
,
OTV_Validator
valid
);
OTV_Validator
ot
valid
);
/*************************************************************************/
/*************************************************************************/
...
@@ -316,13 +316,13 @@ FT_BEGIN_HEADER
...
@@ -316,13 +316,13 @@ FT_BEGIN_HEADER
FT_LOCAL
(
void
)
FT_LOCAL
(
void
)
otv_Script_validate
(
FT_Bytes
table
,
otv_Script_validate
(
FT_Bytes
table
,
OTV_Validator
valid
);
OTV_Validator
ot
valid
);
/* features must already be validated */
/* features must already be validated */
FT_LOCAL
(
void
)
FT_LOCAL
(
void
)
otv_ScriptList_validate
(
FT_Bytes
table
,
otv_ScriptList_validate
(
FT_Bytes
table
,
FT_Bytes
features
,
FT_Bytes
features
,
OTV_Validator
valid
);
OTV_Validator
ot
valid
);
/*************************************************************************/
/*************************************************************************/
...
@@ -349,7 +349,7 @@ FT_BEGIN_HEADER
...
@@ -349,7 +349,7 @@ FT_BEGIN_HEADER
FT_LOCAL
(
void
)
FT_LOCAL
(
void
)
otv_x_Ox
(
FT_Bytes
table
,
otv_x_Ox
(
FT_Bytes
table
,
OTV_Validator
valid
);
OTV_Validator
ot
valid
);
#define AlternateSubstFormat1Func otv_u_C_x_Ox
#define AlternateSubstFormat1Func otv_u_C_x_Ox
#define ChainContextPosFormat1Func otv_u_C_x_Ox
#define ChainContextPosFormat1Func otv_u_C_x_Ox
...
@@ -361,7 +361,7 @@ FT_BEGIN_HEADER
...
@@ -361,7 +361,7 @@ FT_BEGIN_HEADER
FT_LOCAL
(
void
)
FT_LOCAL
(
void
)
otv_u_C_x_Ox
(
FT_Bytes
table
,
otv_u_C_x_Ox
(
FT_Bytes
table
,
OTV_Validator
valid
);
OTV_Validator
ot
valid
);
#define AlternateSetFunc otv_x_ux
#define AlternateSetFunc otv_x_ux
#define AttachPointFunc otv_x_ux
#define AttachPointFunc otv_x_ux
...
@@ -372,7 +372,7 @@ FT_BEGIN_HEADER
...
@@ -372,7 +372,7 @@ FT_BEGIN_HEADER
FT_LOCAL
(
void
)
FT_LOCAL
(
void
)
otv_x_ux
(
FT_Bytes
table
,
otv_x_ux
(
FT_Bytes
table
,
OTV_Validator
valid
);
OTV_Validator
ot
valid
);
#define PosClassRuleFunc otv_x_y_ux_sy
#define PosClassRuleFunc otv_x_y_ux_sy
#define PosRuleFunc otv_x_y_ux_sy
#define PosRuleFunc otv_x_y_ux_sy
...
@@ -381,7 +381,7 @@ FT_BEGIN_HEADER
...
@@ -381,7 +381,7 @@ FT_BEGIN_HEADER
FT_LOCAL
(
void
)
FT_LOCAL
(
void
)
otv_x_y_ux_sy
(
FT_Bytes
table
,
otv_x_y_ux_sy
(
FT_Bytes
table
,
OTV_Validator
valid
);
OTV_Validator
ot
valid
);
#define ChainPosClassRuleFunc otv_x_ux_y_uy_z_uz_p_sp
#define ChainPosClassRuleFunc otv_x_ux_y_uy_z_uz_p_sp
#define ChainPosRuleFunc otv_x_ux_y_uy_z_uz_p_sp
#define ChainPosRuleFunc otv_x_ux_y_uy_z_uz_p_sp
...
@@ -390,35 +390,35 @@ FT_BEGIN_HEADER
...
@@ -390,35 +390,35 @@ FT_BEGIN_HEADER
FT_LOCAL
(
void
)
FT_LOCAL
(
void
)
otv_x_ux_y_uy_z_uz_p_sp
(
FT_Bytes
table
,
otv_x_ux_y_uy_z_uz_p_sp
(
FT_Bytes
table
,
OTV_Validator
valid
);
OTV_Validator
ot
valid
);
#define ContextPosFormat2Func otv_u_O_O_x_Onx
#define ContextPosFormat2Func otv_u_O_O_x_Onx
#define ContextSubstFormat2Func otv_u_O_O_x_Onx
#define ContextSubstFormat2Func otv_u_O_O_x_Onx
FT_LOCAL
(
void
)
FT_LOCAL
(
void
)
otv_u_O_O_x_Onx
(
FT_Bytes
table
,
otv_u_O_O_x_Onx
(
FT_Bytes
table
,
OTV_Validator
valid
);
OTV_Validator
ot
valid
);
#define ContextPosFormat3Func otv_u_x_y_Ox_sy
#define ContextPosFormat3Func otv_u_x_y_Ox_sy
#define ContextSubstFormat3Func otv_u_x_y_Ox_sy
#define ContextSubstFormat3Func otv_u_x_y_Ox_sy
FT_LOCAL
(
void
)
FT_LOCAL
(
void
)
otv_u_x_y_Ox_sy
(
FT_Bytes
table
,
otv_u_x_y_Ox_sy
(
FT_Bytes
table
,
OTV_Validator
valid
);
OTV_Validator
ot
valid
);
#define ChainContextPosFormat2Func otv_u_O_O_O_O_x_Onx
#define ChainContextPosFormat2Func otv_u_O_O_O_O_x_Onx
#define ChainContextSubstFormat2Func otv_u_O_O_O_O_x_Onx
#define ChainContextSubstFormat2Func otv_u_O_O_O_O_x_Onx
FT_LOCAL
(
void
)
FT_LOCAL
(
void
)
otv_u_O_O_O_O_x_Onx
(
FT_Bytes
table
,
otv_u_O_O_O_O_x_Onx
(
FT_Bytes
table
,
OTV_Validator
valid
);
OTV_Validator
ot
valid
);
#define ChainContextPosFormat3Func otv_u_x_Ox_y_Oy_z_Oz_p_sp
#define ChainContextPosFormat3Func otv_u_x_Ox_y_Oy_z_Oz_p_sp
#define ChainContextSubstFormat3Func otv_u_x_Ox_y_Oy_z_Oz_p_sp
#define ChainContextSubstFormat3Func otv_u_x_Ox_y_Oy_z_Oz_p_sp
FT_LOCAL
(
void
)
FT_LOCAL
(
void
)
otv_u_x_Ox_y_Oy_z_Oz_p_sp
(
FT_Bytes
table
,
otv_u_x_Ox_y_Oy_z_Oz_p_sp
(
FT_Bytes
table
,
OTV_Validator
valid
);
OTV_Validator
ot
valid
);
FT_LOCAL
(
FT_UInt
)
FT_LOCAL
(
FT_UInt
)
...
...
components/external/freetype/src/otvalid/otvgdef.c
浏览文件 @
2fc33973
...
@@ -45,7 +45,7 @@
...
@@ -45,7 +45,7 @@
static
void
static
void
otv_O_x_Ox
(
FT_Bytes
table
,
otv_O_x_Ox
(
FT_Bytes
table
,
OTV_Validator
valid
)
OTV_Validator
ot
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
FT_Bytes
Coverage
;
FT_Bytes
Coverage
;
...
@@ -61,20 +61,20 @@
...
@@ -61,20 +61,20 @@
OTV_TRACE
((
" (GlyphCount = %d)
\n
"
,
GlyphCount
));
OTV_TRACE
((
" (GlyphCount = %d)
\n
"
,
GlyphCount
));
otv_Coverage_validate
(
Coverage
,
valid
,
GlyphCount
);
otv_Coverage_validate
(
Coverage
,
ot
valid
,
GlyphCount
);
if
(
GlyphCount
!=
otv_Coverage_get_count
(
Coverage
)
)
if
(
GlyphCount
!=
otv_Coverage_get_count
(
Coverage
)
)
FT_INVALID_DATA
;
FT_INVALID_DATA
;
OTV_LIMIT_CHECK
(
GlyphCount
*
2
);
OTV_LIMIT_CHECK
(
GlyphCount
*
2
);
valid
->
nesting_level
++
;
ot
valid
->
nesting_level
++
;
func
=
valid
->
func
[
valid
->
nesting_level
];
func
=
otvalid
->
func
[
ot
valid
->
nesting_level
];
valid
->
extra1
=
0
;
ot
valid
->
extra1
=
0
;
for
(
;
GlyphCount
>
0
;
GlyphCount
--
)
for
(
;
GlyphCount
>
0
;
GlyphCount
--
)
func
(
table
+
FT_NEXT_USHORT
(
p
),
valid
);
func
(
table
+
FT_NEXT_USHORT
(
p
),
ot
valid
);
valid
->
nesting_level
--
;
ot
valid
->
nesting_level
--
;
OTV_EXIT
;
OTV_EXIT
;
}
}
...
@@ -92,7 +92,7 @@
...
@@ -92,7 +92,7 @@
static
void
static
void
otv_CaretValue_validate
(
FT_Bytes
table
,
otv_CaretValue_validate
(
FT_Bytes
table
,
OTV_Validator
valid
)
OTV_Validator
ot
valid
)
{
{
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
FT_UInt
CaretValueFormat
;
FT_UInt
CaretValueFormat
;
...
@@ -122,7 +122,7 @@
...
@@ -122,7 +122,7 @@
OTV_LIMIT_CHECK
(
2
);
OTV_LIMIT_CHECK
(
2
);
/* DeviceTable */
/* DeviceTable */
otv_Device_validate
(
table
+
FT_NEXT_USHORT
(
p
),
valid
);
otv_Device_validate
(
table
+
FT_NEXT_USHORT
(
p
),
ot
valid
);
break
;
break
;
default:
default:
...
@@ -141,7 +141,7 @@
...
@@ -141,7 +141,7 @@
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/* sets valid->glyph_count */
/* sets
ot
valid->glyph_count */
FT_LOCAL_DEF
(
void
)
FT_LOCAL_DEF
(
void
)
otv_GDEF_validate
(
FT_Bytes
table
,
otv_GDEF_validate
(
FT_Bytes
table
,
...
@@ -150,8 +150,8 @@
...
@@ -150,8 +150,8 @@
FT_UInt
glyph_count
,
FT_UInt
glyph_count
,
FT_Validator
ftvalid
)
FT_Validator
ftvalid
)
{
{
OTV_ValidatorRec
validrec
;
OTV_ValidatorRec
ot
validrec
;
OTV_Validator
valid
=
&
validrec
;
OTV_Validator
otvalid
=
&
ot
validrec
;
FT_Bytes
p
=
table
;
FT_Bytes
p
=
table
;
FT_UInt
table_size
;
FT_UInt
table_size
;
FT_Bool
need_MarkAttachClassDef
;
FT_Bool
need_MarkAttachClassDef
;
...
@@ -162,7 +162,7 @@
...
@@ -162,7 +162,7 @@
OTV_OPTIONAL_TABLE
(
MarkAttachClassDef
);
OTV_OPTIONAL_TABLE
(
MarkAttachClassDef
);
valid
->
root
=
ftvalid
;
ot
valid
->
root
=
ftvalid
;
FT_TRACE3
((
"validating GDEF table
\n
"
));
FT_TRACE3
((
"validating GDEF table
\n
"
));
OTV_INIT
;
OTV_INIT
;
...
@@ -186,19 +186,19 @@
...
@@ -186,19 +186,19 @@
else
else
table_size
=
10
;
/* OpenType < 1.2 */
table_size
=
10
;
/* OpenType < 1.2 */
valid
->
glyph_count
=
glyph_count
;
ot
valid
->
glyph_count
=
glyph_count
;
OTV_OPTIONAL_OFFSET
(
GlyphClassDef
);
OTV_OPTIONAL_OFFSET
(
GlyphClassDef
);
OTV_SIZE_CHECK
(
GlyphClassDef
);
OTV_SIZE_CHECK
(
GlyphClassDef
);
if
(
GlyphClassDef
)
if
(
GlyphClassDef
)
otv_ClassDef_validate
(
table
+
GlyphClassDef
,
valid
);
otv_ClassDef_validate
(
table
+
GlyphClassDef
,
ot
valid
);
OTV_OPTIONAL_OFFSET
(
AttachListOffset
);
OTV_OPTIONAL_OFFSET
(
AttachListOffset
);
OTV_SIZE_CHECK
(
AttachListOffset
);
OTV_SIZE_CHECK
(
AttachListOffset
);
if
(
AttachListOffset
)
if
(
AttachListOffset
)
{
{
OTV_NEST2
(
AttachList
,
AttachPoint
);
OTV_NEST2
(
AttachList
,
AttachPoint
);
OTV_RUN
(
table
+
AttachListOffset
,
valid
);
OTV_RUN
(
table
+
AttachListOffset
,
ot
valid
);
}
}
OTV_OPTIONAL_OFFSET
(
LigCaretListOffset
);
OTV_OPTIONAL_OFFSET
(
LigCaretListOffset
);
...
@@ -206,7 +206,7 @@
...
@@ -206,7 +206,7 @@
if
(
LigCaretListOffset
)
if
(
LigCaretListOffset
)
{
{
OTV_NEST3
(
LigCaretList
,
LigGlyph
,
CaretValue
);
OTV_NEST3
(
LigCaretList
,
LigGlyph
,
CaretValue
);
OTV_RUN
(
table
+
LigCaretListOffset
,
valid
);
OTV_RUN
(
table
+
LigCaretListOffset
,
ot
valid
);
}
}
if
(
need_MarkAttachClassDef
)
if
(
need_MarkAttachClassDef
)
...
@@ -214,7 +214,7 @@
...
@@ -214,7 +214,7 @@
OTV_OPTIONAL_OFFSET
(
MarkAttachClassDef
);
OTV_OPTIONAL_OFFSET
(
MarkAttachClassDef
);
OTV_SIZE_CHECK
(
MarkAttachClassDef
);
OTV_SIZE_CHECK
(
MarkAttachClassDef
);
if
(
MarkAttachClassDef
)
if
(
MarkAttachClassDef
)
otv_ClassDef_validate
(
table
+
MarkAttachClassDef
,
valid
);
otv_ClassDef_validate
(
table
+
MarkAttachClassDef
,
ot
valid
);
}
}
FT_TRACE4
((
"
\n
"
));
FT_TRACE4
((
"
\n
"
));
...
...
components/external/freetype/src/otvalid/otvgpos.c
浏览文件 @
2fc33973
此差异已折叠。
点击以展开。
components/external/freetype/src/otvalid/otvgsub.c
浏览文件 @
2fc33973
此差异已折叠。
点击以展开。
components/external/freetype/src/otvalid/otvjstf.c
浏览文件 @
2fc33973
此差异已折叠。
点击以展开。
components/external/freetype/src/otvalid/otvmath.c
浏览文件 @
2fc33973
此差异已折叠。
点击以展开。
components/external/freetype/src/pcf/pcfread.c
浏览文件 @
2fc33973
此差异已折叠。
点击以展开。
components/external/freetype/src/pfr/pfrload.c
浏览文件 @
2fc33973
...
@@ -179,7 +179,7 @@
...
@@ -179,7 +179,7 @@
if
(
header
->
signature
!=
0x50465230L
||
/* "PFR0" */
if
(
header
->
signature
!=
0x50465230L
||
/* "PFR0" */
header
->
version
>
4
||
header
->
version
>
4
||
header
->
header_size
<
58
||
header
->
header_size
<
58
||
header
->
signature2
!=
0x0
d0a
)
/* CR/LF */
header
->
signature2
!=
0x0
D0A
)
/* CR/LF */
{
{
result
=
0
;
result
=
0
;
}
}
...
...
components/external/freetype/src/psaux/psconv.c
浏览文件 @
2fc33973
...
@@ -124,7 +124,7 @@
...
@@ -124,7 +124,7 @@
if
(
IS_PS_SPACE
(
*
p
)
||
*
p
OP
0x80
)
if
(
IS_PS_SPACE
(
*
p
)
||
*
p
OP
0x80
)
break
;
break
;
c
=
ft_char_table
[
*
p
&
0x7
f
];
c
=
ft_char_table
[
*
p
&
0x7
F
];
if
(
c
<
0
||
c
>=
base
)
if
(
c
<
0
||
c
>=
base
)
break
;
break
;
...
@@ -245,7 +245,7 @@
...
@@ -245,7 +245,7 @@
if
(
IS_PS_SPACE
(
*
p
)
||
*
p
OP
0x80
)
if
(
IS_PS_SPACE
(
*
p
)
||
*
p
OP
0x80
)
break
;
break
;
c
=
ft_char_table
[
*
p
&
0x7
f
];
c
=
ft_char_table
[
*
p
&
0x7
F
];
if
(
c
<
0
||
c
>=
10
)
if
(
c
<
0
||
c
>=
10
)
break
;
break
;
...
@@ -521,7 +521,7 @@
...
@@ -521,7 +521,7 @@
if
(
*
p
OP
0x80
)
if
(
*
p
OP
0x80
)
break
;
break
;
c
=
ft_char_table
[
*
p
&
0x7
f
];
c
=
ft_char_table
[
*
p
&
0x7
F
];
if
(
(
unsigned
)
c
>=
16
)
if
(
(
unsigned
)
c
>=
16
)
break
;
break
;
...
...
components/external/freetype/src/psnames/psmodule.c
浏览文件 @
2fc33973
此差异已折叠。
点击以展开。
components/external/freetype/src/sfnt/sfdriver.c
浏览文件 @
2fc33973
...
@@ -427,7 +427,7 @@
...
@@ -427,7 +427,7 @@
sfnt_get_interface
(
FT_Module
module
,
sfnt_get_interface
(
FT_Module
module
,
const
char
*
module_interface
)
const
char
*
module_interface
)
{
{
/* SFNT_SERVICES_GET derefers `library' in PIC mode */
/* SFNT_SERVICES_GET derefer
ence
s `library' in PIC mode */
#ifdef FT_CONFIG_OPTION_PIC
#ifdef FT_CONFIG_OPTION_PIC
FT_Library
library
;
FT_Library
library
;
...
...
components/external/freetype/src/sfnt/ttcmap.c
浏览文件 @
2fc33973
此差异已折叠。
点击以展开。
components/external/freetype/src/smooth/ftgrays.c
浏览文件 @
2fc33973
此差异已折叠。
点击以展开。
components/external/freetype/src/tools/docmaker/formatter.py
浏览文件 @
2fc33973
此差异已折叠。
点击以展开。
components/external/freetype/src/tools/docmaker/tohtml.py
浏览文件 @
2fc33973
此差异已折叠。
点击以展开。
components/external/freetype/src/tools/ftrandom/ftrandom.c
浏览文件 @
2fc33973
此差异已折叠。
点击以展开。
components/external/freetype/src/tools/test_trig.c
浏览文件 @
2fc33973
此差异已折叠。
点击以展开。
components/external/freetype/src/truetype/ttdriver.c
浏览文件 @
2fc33973
此差异已折叠。
点击以展开。
components/external/freetype/src/truetype/ttinterp.c
浏览文件 @
2fc33973
此差异已折叠。
点击以展开。
components/external/freetype/src/truetype/ttobjs.c
浏览文件 @
2fc33973
此差异已折叠。
点击以展开。
components/external/freetype/src/type42/t42parse.c
浏览文件 @
2fc33973
此差异已折叠。
点击以展开。
components/external/freetype/src/winfonts/winfnt.c
浏览文件 @
2fc33973
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录