[HarfBuzz] harfbuzz: Branch 'master'

Behdad Esfahbod behdad at kemper.freedesktop.org
Tue Dec 19 19:48:58 UTC 2017


 src/hb-set-private.hh |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 2fe5f885b6f66f2665292b93e07baaae0aa46da8
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Tue Dec 19 14:48:26 2017 -0500

    [set] Handle nil set in add_range() / add_sorted_array()
    
    Fixes https://github.com/harfbuzz/harfbuzz/issues/657

diff --git a/src/hb-set-private.hh b/src/hb-set-private.hh
index 4715e1f3..9c6f3ee3 100644
--- a/src/hb-set-private.hh
+++ b/src/hb-set-private.hh
@@ -230,7 +230,8 @@ struct hb_set_t
   }
   inline bool add_range (hb_codepoint_t a, hb_codepoint_t b)
   {
-    if (unlikely (in_error || a > b || a == INVALID || b == INVALID)) return false;
+    if (unlikely (in_error)) return true; /* https://github.com/harfbuzz/harfbuzz/issues/657 */
+    if (unlikely (a > b || a == INVALID || b == INVALID)) return false;
     unsigned int ma = get_major (a);
     unsigned int mb = get_major (b);
     if (ma == mb)
@@ -283,7 +284,7 @@ struct hb_set_t
   template <typename T>
   inline bool add_sorted_array (const T *array, unsigned int count, unsigned int stride=sizeof(T))
   {
-    if (unlikely (in_error)) return false;
+    if (unlikely (in_error)) return true; /* https://github.com/harfbuzz/harfbuzz/issues/657 */
     if (!count) return true;
     hb_codepoint_t g = *array;
     hb_codepoint_t last_g = g;


More information about the HarfBuzz mailing list