* src/otlayout/otlayout.h: Add copyright. (OTL_INVALID_OFFSET): Removed. * src/otlayout/otlgdef.h: Include otlayout.h. Comment out inclusion of otltable.h. * src/otlayout/otlgpos.c (otl_gpos_lookup4_validate): Fix call to otl_base_array_validate. (otl_liga_mark2_validate): Fix `for' loop. * src/otlayout/otlgsub.c (otl_ligature_validate): Check `glyph_id', not components array. * src/otlcommn.c (otl_lookup_get_count, otl_feature_get_count): Comment out. (otl_lookup_list_get_count, otl_feature_list_get_count): Activate. (otl_feature_list_validate, otl_gsubgpos_get_lookup_count): s/otl_lookup_get_count/otl_lookup_list_get_count/. (otl_script_list_validate): s/otl_feature_get_count/otl_feature_list_get_count/. (otl_script_validate): Call otl_lang_validate for default language. * src/otlayout/otlcommn.h: Updated.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299
diff --git a/ChangeLog b/ChangeLog
index 50e8012..1ccb500 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,29 @@
+2004-08-27 Werner Lemberg <wl@gnu.org>
+
+ * src/otlayout/otlayout.h: Add copyright.
+ (OTL_INVALID_OFFSET): Removed.
+
+ * src/otlayout/otlgdef.h: Include otlayout.h.
+ Comment out inclusion of otltable.h.
+
+ * src/otlayout/otlgpos.c (otl_gpos_lookup4_validate): Fix call
+ to otl_base_array_validate.
+ (otl_liga_mark2_validate): Fix `for' loop.
+
+ * src/otlayout/otlgsub.c (otl_ligature_validate): Check `glyph_id',
+ not components array.
+
+ * src/otlcommn.c (otl_lookup_get_count, otl_feature_get_count):
+ Comment out.
+ (otl_lookup_list_get_count, otl_feature_list_get_count): Activate.
+ (otl_feature_list_validate, otl_gsubgpos_get_lookup_count):
+ s/otl_lookup_get_count/otl_lookup_list_get_count/.
+ (otl_script_list_validate):
+ s/otl_feature_get_count/otl_feature_list_get_count/.
+ (otl_script_validate): Call otl_lang_validate for default language.
+
+ * src/otlayout/otlcommn.h: Updated.
+
2004-08-16 Werner Lemberg <wl@gnu.org>
* src/otlayout/otlgpos.c (otl_gpos_lookup1_validate,
diff --git a/src/otlayout/otlayout.h b/src/otlayout/otlayout.h
index 21988f3..c177cc2 100644
--- a/src/otlayout/otlayout.h
+++ b/src/otlayout/otlayout.h
@@ -1,3 +1,21 @@
+/***************************************************************************/
+/* */
+/* otlayout.h */
+/* */
+/* OpenType layout support (specification only). */
+/* */
+/* Copyright 2002, 2004 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
#ifndef __OT_LAYOUT_H__
#define __OT_LAYOUT_H__
@@ -200,7 +218,6 @@ OTL_BEGIN_HEADER
#define OTL_INVALID(e) otl_validator_error( valid, e )
#define OTL_INVALID_TOO_SHORT OTL_INVALID( OTL_Err_InvalidSize )
-#define OTL_INVALID_OFFSET OTL_INVALID( OTL_Err_InvalidOffset )
#define OTL_INVALID_DATA OTL_INVALID( OTL_Err_InvalidData )
#define OTL_INVALID_FORMAT OTL_INVALID( OTL_Err_InvalidFormat )
@@ -214,3 +231,6 @@ OTL_BEGIN_HEADER
OTL_END_HEADER
#endif /* __OT_LAYOUT_H__ */
+
+
+/* END */
diff --git a/src/otlayout/otlcommn.c b/src/otlayout/otlcommn.c
index 802266e..d841167 100644
--- a/src/otlayout/otlcommn.c
+++ b/src/otlayout/otlcommn.c
@@ -512,6 +512,7 @@
}
+#if 0
OTL_LOCALDEF( OTL_UInt )
otl_lookup_get_count( OTL_Bytes table )
{
@@ -520,6 +521,7 @@
return OTL_PEEK_USHORT( p );
}
+#endif
#if 0
@@ -575,7 +577,6 @@
}
-#if 0
OTL_LOCALDEF( OTL_UInt )
otl_lookup_list_get_count( OTL_Bytes table )
{
@@ -584,7 +585,6 @@
return OTL_PEEK_USHORT( p );
}
-#endif
#if 0
@@ -671,6 +671,7 @@
}
+#if 0
OTL_LOCALDEF( OTL_UInt )
otl_feature_get_count( OTL_Bytes table )
{
@@ -679,6 +680,7 @@
return OTL_PEEK_USHORT( p );
}
+#endif
#if 0
@@ -730,7 +732,7 @@
num_features = OTL_NEXT_USHORT( p );
OTL_CHECK( 2 * num_features );
- lookup_count = otl_lookup_get_count( lookups );
+ lookup_count = otl_lookup_list_get_count( lookups );
/* scan feature records */
for ( ; num_features > 0; num_features-- )
@@ -743,7 +745,6 @@
}
-#if 0
OTL_LOCALDEF( OTL_UInt )
otl_feature_list_get_count( OTL_Bytes table )
{
@@ -752,7 +753,6 @@
return OTL_PEEK_USHORT( p );
}
-#endif
#if 0
@@ -906,10 +906,7 @@
num_langs = OTL_NEXT_USHORT( p );
if ( default_lang != 0 )
- {
- if ( table + default_lang >= valid->limit )
- OTL_INVALID_OFFSET;
- }
+ otl_lang_validate( table + default_lang, feature_count, valid );
OTL_CHECK( num_langs * 6 );
@@ -936,7 +933,7 @@
num_scripts = OTL_NEXT_USHORT( p );
OTL_CHECK( num_scripts * 6 );
- feature_count = otl_feature_get_count( features );
+ feature_count = otl_feature_list_get_count( features );
/* scan script records */
for ( ; num_scripts > 0; num_scripts-- )
@@ -963,7 +960,7 @@
OTL_Bytes p = table + 8;
- return otl_lookup_get_count( table + OTL_PEEK_USHORT( p ) );
+ return otl_lookup_list_get_count( table + OTL_PEEK_USHORT( p ) );
}
diff --git a/src/otlayout/otlcommn.h b/src/otlayout/otlcommn.h
index de8e747..000d5ab 100644
--- a/src/otlayout/otlcommn.h
+++ b/src/otlayout/otlcommn.h
@@ -128,9 +128,11 @@ OTL_BEGIN_HEADER
OTL_UInt glyph_count,
OTL_Validator valid );
+#if 0
/* return number of sub-tables in a lookup */
OTL_LOCAL( OTL_UInt )
otl_lookup_get_count( OTL_Bytes table );
+#endif
#if 0
/* return lookup sub-table */
@@ -156,11 +158,9 @@ OTL_BEGIN_HEADER
OTL_UInt glyph_count,
OTL_Validator valid );
-#if 0
/* return number of lookups in list */
OTL_LOCAL( OTL_UInt )
otl_lookup_list_get_count( OTL_Bytes table );
-#endif
#if 0
/* return a given lookup from a list */
@@ -200,9 +200,11 @@ OTL_BEGIN_HEADER
OTL_UInt lookup_count,
OTL_Validator valid );
+#if 0
/* return feature's lookup count */
OTL_LOCAL( OTL_UInt )
otl_feature_get_count( OTL_Bytes table );
+#endif
#if 0
/* get several lookups indices from a feature. returns the number of */
@@ -230,11 +232,9 @@ OTL_BEGIN_HEADER
OTL_Bytes lookups,
OTL_Validator valid );
-#if 0
/* return number of features in list */
OTL_LOCAL( OTL_UInt )
otl_feature_list_get_count( OTL_Bytes table );
-#endif
#if 0
/* return a given feature from a list */
diff --git a/src/otlayout/otlgdef.h b/src/otlayout/otlgdef.h
index 359cdf9..dc7d41b 100644
--- a/src/otlayout/otlgdef.h
+++ b/src/otlayout/otlgdef.h
@@ -19,7 +19,11 @@
#ifndef __OTLGDEF_H__
#define __OTLGDEF_H__
+#include "otlayout.h"
+
+#if 0
#include "otltable.h"
+#endif
OTL_BEGIN_HEADER
diff --git a/src/otlayout/otlgpos.c b/src/otlayout/otlgpos.c
index f3de237..6c26433 100644
--- a/src/otlayout/otlgpos.c
+++ b/src/otlayout/otlgpos.c
@@ -477,7 +477,7 @@
otl_coverage_validate( table + base_coverage, valid );
otl_mark_array_validate( table + mark_array, valid );
- otl_base_array_validate( table, num_classes, valid );
+ otl_base_array_validate( table + base_array, num_classes, valid );
}
break;
@@ -514,7 +514,7 @@
/* scan component records */
for ( ; num_components > 0; num_components-- )
/* scan ligature anchor records */
- for ( count = class_count; class_count > 0; class_count-- )
+ for ( count = class_count; count > 0; count-- )
{
OTL_UInt offset = OTL_NEXT_USHORT( p );
diff --git a/src/otlayout/otlgsub.c b/src/otlayout/otlgsub.c
index 5a6b820..ca41d6d 100644
--- a/src/otlayout/otlgsub.c
+++ b/src/otlayout/otlgsub.c
@@ -484,7 +484,10 @@
OTL_CHECK( 4 );
- glyph_id = OTL_NEXT_USHORT( p );
+ glyph_id = OTL_NEXT_USHORT( p );
+ if ( glyph_id >= glyph_count )
+ OTL_INVALID_DATA;
+
num_components = OTL_NEXT_USHORT( p );
if ( num_components == 0 )
@@ -493,10 +496,6 @@
num_components--;
OTL_CHECK( num_components * 2 );
-
- for ( ; num_components > 0; num_components-- )
- if ( OTL_NEXT_USHORT( p ) >= glyph_count )
- OTL_INVALID_DATA;
}