shithub: freetype+ttf2subf

Download patch

ref: e79e3d3ee37a9545476bd1319b39fa5593b1361f
parent: b2c40b5bba9a6033f876f30bc70257551717279e
author: Werner Lemberg <[email protected]>
date: Sat Aug 28 11:23:04 EDT 2004

* src/otlayout/otlgpos.c (otl_value_length): Return number of bytes,
not number of 16bit entities.
(otl_gpos_lookup2_validate): Check class definition tables for
format 2.
Fix loop for format 2.
(otl_liga_mark2_validate): Fix offset for otl_anchor_validate.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2004-08-28  Werner Lemberg  <[email protected]>
+
+	* src/otlayout/otlgpos.c (otl_value_length): Return number of bytes,
+	not number of 16bit entities.
+	(otl_gpos_lookup2_validate): Check class definition tables for
+	format 2.
+	Fix loop for format 2.
+	(otl_liga_mark2_validate): Fix offset for otl_anchor_validate.
+
 2004-08-27  Werner Lemberg  <[email protected]>
 
 	* src/base/ftmac.c: Don't include truetype/ttobjs.h.
--- a/src/otlayout/otlgpos.c
+++ b/src/otlayout/otlgpos.c
@@ -42,7 +42,7 @@
     count = ( ( count  & 0xCC ) >> 2 ) + ( count  & 0x33 );
     count = ( ( count  & 0xF0 ) >> 4 ) + ( count  & 0x0F );
 
-    return count;
+    return count * 2;
   }
 
 
@@ -314,7 +314,7 @@
     case 2:
       {
         OTL_UInt  coverage, value1, value2, class1, class2;
-        OTL_UInt  num_classes1, num_classes2, len_value1, len_value2;
+        OTL_UInt  num_classes1, num_classes2, len_value1, len_value2, count;
 
 
         OTL_CHECK( 14 );
@@ -330,6 +330,8 @@
         len_value2 = otl_value_length( value2 );
 
         otl_coverage_validate( table + coverage, valid );
+        otl_class_definition_validate( table + class1, valid );
+        otl_class_definition_validate( table + class2, valid );
 
         OTL_CHECK( num_classes1 * num_classes2 *
                      ( len_value1 + len_value2 ) );
@@ -336,7 +338,7 @@
 
         for ( ; num_classes1 > 0; num_classes1-- )
         {
-          for ( ; num_classes2 > 0; num_classes2-- )
+          for ( count = num_classes2; count > 0; count-- )
           {
             otl_value_validate( p, table, value1, valid );
             p += len_value1;
@@ -522,7 +524,7 @@
         if ( !offset && maybe_zero )
           continue;
   
-        otl_anchor_validate( table + OTL_NEXT_USHORT( p ), valid );
+        otl_anchor_validate( table + offset, valid );
       }
   }