[HarfBuzz] harfbuzz: Branch 'master'

Behdad Esfahbod behdad at kemper.freedesktop.org
Thu Sep 24 11:03:49 PDT 2009


 src/harfbuzz-gpos.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit b7151fcec94dc361893c094289f8988cbfa2844f
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Thu Sep 24 14:00:53 2009 -0400

    Bug 23976 memory leak in Free_BaseArray

diff --git a/src/harfbuzz-gpos.c b/src/harfbuzz-gpos.c
index 1ac3779..356dc01 100644
--- a/src/harfbuzz-gpos.c
+++ b/src/harfbuzz-gpos.c
@@ -2059,15 +2059,17 @@ static void  Free_BaseArray( HB_BaseArray*  ba,
   HB_BaseRecord  *br;
   HB_Anchor      *bans;
 
-  HB_UNUSED(num_classes);
-
   if ( ba->BaseRecord )
   {
     br    = ba->BaseRecord;
 
     if ( ba->BaseCount )
     {
+      HB_UShort i, count;
+      count = num_classes * ba->BaseCount;
       bans = br[0].BaseAnchor;
+      for (i = 0; i < count; i++)
+        Free_Anchor (&bans[i]);
       FREE( bans );
     }
 
@@ -2723,7 +2725,7 @@ static HB_Error  Load_Mark2Array( HB_Mark2Array*  m2a,
 {
   HB_Error  error;
 
-  HB_UShort        k, m, n, count;
+  HB_UShort        m, n, count;
   HB_UInt          cur_offset, new_offset, base_offset;
 
   HB_Mark2Record  *m2r;



More information about the HarfBuzz mailing list