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

Behdad Esfahbod behdad at kemper.freedesktop.org
Wed Nov 2 08:09:21 PDT 2011


 contrib/harfbuzz-unicode.c |    2 +-
 src/harfbuzz-gpos.c        |    3 +++
 src/harfbuzz-indic.cpp     |    4 ++--
 src/harfbuzz-tibetan.c     |    2 +-
 4 files changed, 7 insertions(+), 4 deletions(-)

New commits:
commit 93d8573ddcf97648983a1c1b5cdda8a3ec6d4432
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Tue Nov 1 13:33:18 2011 -0400

    Fix bug in contrib/harfbuzz-unicode.c

diff --git a/contrib/harfbuzz-unicode.c b/contrib/harfbuzz-unicode.c
index 049e0ca..ce4f8e2 100644
--- a/contrib/harfbuzz-unicode.c
+++ b/contrib/harfbuzz-unicode.c
@@ -165,7 +165,7 @@ hb_utf16_script_run_prev(unsigned *num_code_points, HB_ScriptItem *output,
     const HB_Script script = code_point_to_script(cp);
 
     if (script != current_script) {
-      if (current_script == init_script == HB_Script_Inherited) {
+      if (current_script == HB_Script_Inherited && init_script == HB_Script_Inherited) {
         // If we started off as inherited, we take whatever we can find.
         output->script = script;
         current_script = script;
commit ff0612c2e7df1b86fc702c72e3015a6a5ae39b4c
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Thu Sep 8 00:42:54 2011 -0400

    Fix OOB access possibility in old harfbuzz
    
    As reported by Kenichi Ishibashi.

diff --git a/src/harfbuzz-tibetan.c b/src/harfbuzz-tibetan.c
index bfa31b1..847ac52 100644
--- a/src/harfbuzz-tibetan.c
+++ b/src/harfbuzz-tibetan.c
@@ -90,7 +90,7 @@ static const unsigned char tibetanForm[0x80] = {
 
 
 #define tibetan_form(c) \
-    (TibetanForm)tibetanForm[c - 0x0f40]
+    ((c) >= 0x0f40 && (c) <= 0x0fc0 ? (TibetanForm)tibetanForm[(c) - 0x0f40] : TibetanOther)
 
 static const HB_OpenTypeFeature tibetan_features[] = {
     { HB_MAKE_TAG('c', 'c', 'm', 'p'), CcmpProperty },
commit 81f2ecafa19b602f950df5a9e6e1b99c4b5ea55e
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Tue Jun 14 16:40:17 2011 -0400

    Bug 30319 - open type init feature applied on character U+09c7 even...

diff --git a/src/harfbuzz-indic.cpp b/src/harfbuzz-indic.cpp
index 4d8418b..ffe9573 100644
--- a/src/harfbuzz-indic.cpp
+++ b/src/harfbuzz-indic.cpp
@@ -37,7 +37,7 @@ static HB_Bool isLetter(HB_UChar16 ucs)
                      FLAG(HB_Letter_Titlecase) |
                      FLAG(HB_Letter_Modifier) |
                      FLAG(HB_Letter_Other);
-    return FLAG(HB_GetUnicodeCharCategory(ucs)) & test;
+    return !!(FLAG(HB_GetUnicodeCharCategory(ucs)) & test);
 }
 
 static HB_Bool isMark(HB_UChar16 ucs)
@@ -45,7 +45,7 @@ static HB_Bool isMark(HB_UChar16 ucs)
     const int test = FLAG(HB_Mark_NonSpacing) |
                      FLAG(HB_Mark_SpacingCombining) |
                      FLAG(HB_Mark_Enclosing);
-    return FLAG(HB_GetUnicodeCharCategory(ucs)) & test;
+    return !!(FLAG(HB_GetUnicodeCharCategory(ucs)) & test);
 }
 
 enum Form {
commit 81c8ef785b079980ad5b46be4fe7c7bf156dbf65
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Tue May 10 15:47:24 2011 -0400

    Fix crash!

diff --git a/src/harfbuzz-gpos.c b/src/harfbuzz-gpos.c
index a216005..7bd3b3b 100644
--- a/src/harfbuzz-gpos.c
+++ b/src/harfbuzz-gpos.c
@@ -3012,6 +3012,9 @@ static HB_Error  Lookup_MarkMarkPos( GPOS_Instance*    gpi,
     j--;
   }
 
+  if ( i > buffer->in_pos )
+    return HB_Err_Not_Covered;
+
   error = _HB_OPEN_Coverage_Index( &mmp->Mark2Coverage, IN_GLYPH( j ),
 			  &mark2_index );
   if ( error )



More information about the HarfBuzz mailing list