[HarfBuzz] harfbuzz: Branch 'master' - 2 commits

Simon Hausmann hausmann at kemper.freedesktop.org
Sun Aug 26 06:04:23 PDT 2007


Rebased ref, commits from common ancestor:
diff-tree 2c4b930605c1660dd3843117b0d729fcf386bcab (from parents)
Merge: 5ae52c37acc729d7927d003170de8dcfb8d951cf 8dd0a6c211b32705af991a93fe15803d5bd5d921
Author: Simon Hausmann <shausman at trolltech.com>
Date:   Sun Aug 26 15:04:12 2007 +0200

    Merge branch 'stable'
    
    Conflicts:
    
    	src/harfbuzz-gpos.c
    	src/harfbuzz-gsub.c

diff --cc src/harfbuzz-gpos.c
index 2e3c211,6f0476a..8da4540
@@@ -1458,16 -1515,16 +1458,16 @@@
  }
  
  
 -static FT_Error  Lookup_PairPos1( GPOS_Instance*       gpi,
 +static HB_Error  Lookup_PairPos1( GPOS_Instance*       gpi,
  				  HB_PairPosFormat1*  ppf1,
  				  HB_Buffer           buffer,
- 				  HB_UShort            first_pos,
 -				  FT_ULong             first_pos,
 -				  FT_UShort            index,
 -				  FT_UShort            format1,
 -				  FT_UShort            format2 )
++				  HB_UInt              first_pos,
 +				  HB_UShort            index,
 +				  HB_UShort            format1,
 +				  HB_UShort            format2 )
  {
 -  FT_Error              error;
 -  FT_UShort             numpvr, glyph2;
 +  HB_Error              error;
 +  HB_UShort             numpvr, glyph2;
  
    HB_PairValueRecord*  pvr;
  
@@@ -1500,15 -1557,15 +1500,15 @@@
  }
  
  
 -static FT_Error  Lookup_PairPos2( GPOS_Instance*       gpi,
 +static HB_Error  Lookup_PairPos2( GPOS_Instance*       gpi,
  				  HB_PairPosFormat2*  ppf2,
  				  HB_Buffer           buffer,
- 				  HB_UShort            first_pos,
 -				  FT_ULong             first_pos,
 -				  FT_UShort            format1,
 -				  FT_UShort            format2 )
++				  HB_UInt              first_pos,
 +				  HB_UShort            format1,
 +				  HB_UShort            format2 )
  {
 -  FT_Error           error;
 -  FT_UShort          cl1, cl2;
 +  HB_Error           error;
 +  HB_UShort          cl1, cl2;
  
    HB_Class1Record*  c1r;
    HB_Class2Record*  c2r;
@@@ -1535,15 -1592,16 +1535,16 @@@
  }
  
  
 -static FT_Error  Lookup_PairPos( GPOS_Instance*    gpi,
 +static HB_Error  Lookup_PairPos( GPOS_Instance*    gpi,
  				 HB_GPOS_SubTable* st,
  				 HB_Buffer        buffer,
 -				 FT_UShort         flags,
 -				 FT_UShort         context_length,
 +				 HB_UShort         flags,
 +				 HB_UShort         context_length,
  				 int               nesting_level )
  {
 -  FT_Error         error;
 -  FT_UShort        index, property;
 -  FT_ULong         first_pos;
 +  HB_Error         error;
-   HB_UShort        index, property, first_pos;
++  HB_UShort        index, property;
++  HB_UInt          first_pos;
    HB_GPOSHeader*  gpos = gpi->gpos;
    HB_PairPos*     pp = &st->pair;
  
@@@ -3063,8 -3141,8 +3068,8 @@@
  				HB_Buffer            buffer,
  				int                   nesting_level )
  {
 -  FT_Error  error;
 -  FT_ULong i, old_pos;
 +  HB_Error  error;
-   HB_UShort i, old_pos;
++  HB_UInt   i, old_pos;
  
  
    i = 0;
diff --cc src/harfbuzz-gsub.c
index 427385c,23b87b8..5cdd801
@@@ -1088,8 -1129,8 +1088,8 @@@
  				  HB_Buffer             buffer,
  				  int                    nesting_level )
  {
 -  FT_Error  error;
 -  FT_ULong i, old_pos;
 +  HB_Error  error;
-   HB_UShort i, old_pos;
++  HB_UInt   i, old_pos;
  
  
    i = 0;
diff-tree 8dd0a6c211b32705af991a93fe15803d5bd5d921 (from f2acc48e352c09c6c8f714c1e24ca5bc490da113)
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sun Aug 26 14:43:27 2007 +0200

    [HarfBuzz] Another fix
    
    The actual fix for this bug now:
    
            http://bugzilla.gnome.org/show_bug.cgi?id=463430
    
    The bug was that an intermediate index variable was of type FT_UShort
    and overflowing with more than 65536 input glyphs.  Yikes!  Patch
    attached.

diff --git a/src/harfbuzz-gpos.c b/src/harfbuzz-gpos.c
index 513f3fb..6f0476a 100644
--- a/src/harfbuzz-gpos.c
+++ b/src/harfbuzz-gpos.c
@@ -1518,7 +1518,7 @@ static void  Free_PairPos( HB_GPOS_SubTa
 static FT_Error  Lookup_PairPos1( GPOS_Instance*       gpi,
 				  HB_PairPosFormat1*  ppf1,
 				  HB_Buffer           buffer,
-				  FT_UShort            first_pos,
+				  FT_ULong             first_pos,
 				  FT_UShort            index,
 				  FT_UShort            format1,
 				  FT_UShort            format2 )
@@ -1560,7 +1560,7 @@ static FT_Error  Lookup_PairPos1( GPOS_I
 static FT_Error  Lookup_PairPos2( GPOS_Instance*       gpi,
 				  HB_PairPosFormat2*  ppf2,
 				  HB_Buffer           buffer,
-				  FT_UShort            first_pos,
+				  FT_ULong             first_pos,
 				  FT_UShort            format1,
 				  FT_UShort            format2 )
 {
@@ -1600,7 +1600,8 @@ static FT_Error  Lookup_PairPos( GPOS_In
 				 int               nesting_level )
 {
   FT_Error         error;
-  FT_UShort        index, property, first_pos;
+  FT_UShort        index, property;
+  FT_ULong         first_pos;
   HB_GPOSHeader*  gpos = gpi->gpos;
   HB_PairPos*     pp = &st->pair;
 
@@ -1631,8 +1632,12 @@ static FT_Error  Lookup_PairPos( GPOS_In
       return error;
 
     if ( buffer->in_pos == buffer->in_length )
-      return HB_Err_Not_Covered;
+      {
+	buffer->in_pos = first_pos;
+        return HB_Err_Not_Covered;
+      }
     (buffer->in_pos)++;
+
   }
 
   switch ( pp->PosFormat )
@@ -3137,7 +3142,7 @@ static FT_Error  Do_ContextPos( GPOS_Ins
 				int                   nesting_level )
 {
   FT_Error  error;
-  FT_UShort i, old_pos;
+  FT_ULong i, old_pos;
 
 
   i = 0;
diff --git a/src/harfbuzz-gsub.c b/src/harfbuzz-gsub.c
index 00db6e8..23b87b8 100644
--- a/src/harfbuzz-gsub.c
+++ b/src/harfbuzz-gsub.c
@@ -1130,7 +1130,7 @@ static FT_Error  Do_ContextSubst( HB_GSU
 				  int                    nesting_level )
 {
   FT_Error  error;
-  FT_UShort i, old_pos;
+  FT_ULong i, old_pos;
 
 
   i = 0;



More information about the HarfBuzz mailing list