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

Behdad Esfahbod behdad at kemper.freedesktop.org
Mon Jul 30 07:53:39 PDT 2012


 src/harfbuzz-arabic.c   |   12 +++++++++---
 src/harfbuzz-gpos.c     |    6 +++---
 src/harfbuzz-gsub.c     |    6 +++---
 src/harfbuzz-shaper.cpp |    2 +-
 src/harfbuzz-tibetan.c  |    1 +
 5 files changed, 17 insertions(+), 10 deletions(-)

New commits:
commit 3ab7b37bdebf0f8773493a1fee910b151c4de30f
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Mon Jul 30 10:50:22 2012 -0400

    Fix misc leaks
    
    https://bugs.freedesktop.org/show_bug.cgi?id=31992
    https://bugs.freedesktop.org/show_bug.cgi?id=31993
    https://bugs.freedesktop.org/show_bug.cgi?id=31994
    https://bugs.freedesktop.org/show_bug.cgi?id=31995

diff --git a/src/harfbuzz-arabic.c b/src/harfbuzz-arabic.c
index 3837087..51f839a 100644
--- a/src/harfbuzz-arabic.c
+++ b/src/harfbuzz-arabic.c
@@ -1111,16 +1111,22 @@ HB_Bool HB_ArabicShape(HB_ShaperItem *item)
 
     if (HB_SelectScript(item, item->item.script == HB_Script_Arabic ? arabic_features : syriac_features)) {
         HB_Bool ot_ok;
-        if (arabicSyriacOpenTypeShape(item, &ot_ok))
+        if (arabicSyriacOpenTypeShape(item, &ot_ok)) {
+            HB_FREE_STACKARRAY(shapedChars);
             return TRUE;
-        if (ot_ok)
+        }
+        if (ot_ok) {
+            HB_FREE_STACKARRAY(shapedChars);
             return FALSE;
             /* fall through to the non OT code*/
+        }
     }
 #endif
 
-    if (item->item.script != HB_Script_Arabic)
+    if (item->item.script != HB_Script_Arabic) {
+        HB_FREE_STACKARRAY(shapedChars);
         return HB_BasicShape(item);
+    }
 
     shapedString(item->string, item->stringLength, item->item.pos, item->item.length, shapedChars, &slen,
                   item->item.bidiLevel % 2,
diff --git a/src/harfbuzz-gpos.c b/src/harfbuzz-gpos.c
index 7bd3b3b..e969a01 100644
--- a/src/harfbuzz-gpos.c
+++ b/src/harfbuzz-gpos.c
@@ -5171,13 +5171,13 @@ static HB_Error  Lookup_ChainContextPos2(
   if ( error )
     return error;
 
+  if (ccpf2->MaxInputLength < 1)
+    return HB_Err_Not_Covered;
+
   if ( ALLOC_ARRAY( backtrack_classes, ccpf2->MaxBacktrackLength, HB_UShort ) )
     return error;
   known_backtrack_classes = 0;
 
-  if (ccpf2->MaxInputLength < 1)
-    return HB_Err_Not_Covered;
-
   if ( ALLOC_ARRAY( input_classes, ccpf2->MaxInputLength, HB_UShort ) )
     goto End3;
   known_input_classes = 1;
diff --git a/src/harfbuzz-gsub.c b/src/harfbuzz-gsub.c
index 21fec51..ceb7034 100644
--- a/src/harfbuzz-gsub.c
+++ b/src/harfbuzz-gsub.c
@@ -3158,13 +3158,13 @@ static HB_Error  Lookup_ChainContextSubst2( HB_GSUBHeader*               gsub,
   if ( error )
     return error;
 
+  if (ccsf2->MaxInputLength < 1)
+    return HB_Err_Not_Covered;
+
   if ( ALLOC_ARRAY( backtrack_classes, ccsf2->MaxBacktrackLength, HB_UShort ) )
     return error;
   known_backtrack_classes = 0;
 
-  if (ccsf2->MaxInputLength < 1)
-    return HB_Err_Not_Covered;
-
   if ( ALLOC_ARRAY( input_classes, ccsf2->MaxInputLength, HB_UShort ) )
     goto End3;
   known_input_classes = 1;
diff --git a/src/harfbuzz-tibetan.c b/src/harfbuzz-tibetan.c
index 6f9a55b..be38ab2 100644
--- a/src/harfbuzz-tibetan.c
+++ b/src/harfbuzz-tibetan.c
@@ -113,6 +113,7 @@ static HB_Bool tibetan_shape_syllable(HB_Bool openType, HB_ShaperItem *item, HB_
 
     if (item->num_glyphs < item->item.length + 4) {
         item->num_glyphs = item->item.length + 4;
+        HB_FREE_STACKARRAY(reordered);
         return FALSE;
     }
 
commit b847f24ce855d24f6822bcd9c0006905e81b94d8
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed Jul 25 19:29:16 2012 -0400

    [arabic] Fix Arabic cursive positioning
    
    This was clearly broken in testing.  Who knows...  Fixes for me.
    Test with a Nastaleeq font, or with Arabic Typesetting.
    
    Backporting from Chromium.

diff --git a/src/harfbuzz-shaper.cpp b/src/harfbuzz-shaper.cpp
index 7d433ea..7fd04a9 100644
--- a/src/harfbuzz-shaper.cpp
+++ b/src/harfbuzz-shaper.cpp
@@ -1269,7 +1269,7 @@ HB_Bool HB_OpenTypePosition(HB_ShaperItem *item, int availableGlyphs, HB_Bool do
                 adjustment = HB_FIXED_ROUND(adjustment);
 
             if (positions[i].new_advance) {
-                advances[i] = adjustment;
+                ; //advances[i] = adjustment;
             } else {
                 advances[i] += adjustment;
             }



More information about the HarfBuzz mailing list