* src/otlayout/otlgpos.c (otl_liga_mark2_validate): Add parameter to handle possible NULL values properly. Update all callers.
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
diff --git a/ChangeLog b/ChangeLog
index 5532600..3c231f0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2004-08-15 Werner Lemberg <wl@gnu.org>
+ * src/otlayout/otlgpos.c (otl_liga_mark2_validate): Add parameter
+ to handle possible NULL values properly.
+ Update all callers.
+
+2004-08-15 Werner Lemberg <wl@gnu.org>
+
* src/otlayout/gpos.c: Rename counting variables to be more
meaningful.
Add copyright.
diff --git a/src/otlayout/otlgpos.c b/src/otlayout/otlgpos.c
index 9ffa777..d76a4c6 100644
--- a/src/otlayout/otlgpos.c
+++ b/src/otlayout/otlgpos.c
@@ -478,6 +478,7 @@
static void
otl_liga_mark2_validate( OTL_Bytes table,
OTL_UInt class_count,
+ OTL_Bool maybe_zero,
OTL_Validator valid )
{
OTL_Bytes p = table;
@@ -493,7 +494,15 @@
for ( ; num_components > 0; num_components-- )
/* scan ligature anchor records */
for ( count = class_count; class_count > 0; class_count-- )
+ {
+ OTL_UInt offset = OTL_NEXT_USHORT( p );
+
+
+ if ( !offset && maybe_zero )
+ continue;
+
otl_anchor_validate( table + OTL_NEXT_USHORT( p ), valid );
+ }
}
@@ -513,7 +522,7 @@
/* scan ligature attach records */
for ( ; ligature_count > 0; ligature_count-- )
- otl_liga_mark2_validate( table + OTL_NEXT_USHORT( p ), class_count,
+ otl_liga_mark2_validate( table + OTL_NEXT_USHORT( p ), class_count, 1,
valid );
}
@@ -593,7 +602,7 @@
otl_coverage_validate( table + coverage2, valid );
otl_mark_array_validate( table + array1, valid );
- otl_liga_mark2_validate( table + array2, num_classes, valid );
+ otl_liga_mark2_validate( table + array2, num_classes, 0, valid );
}
break;