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

Behdad Esfahbod behdad at kemper.freedesktop.org
Fri Jul 27 21:55:41 UTC 2018


 src/hb-ft.cc                       |    3 +++
 src/hb-iter-private.hh             |    8 +++++---
 src/hb-machinery-private.hh        |    1 -
 src/hb-ot-layout-common-private.hh |    9 +++++++++
 src/hb-ot-shape.cc                 |    3 +++
 5 files changed, 20 insertions(+), 4 deletions(-)

New commits:
commit 42c183f80355fe7cadac2931a23d389285c8b98c
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Fri Jul 27 14:55:29 2018 -0700

    Minor

diff --git a/src/hb-ft.cc b/src/hb-ft.cc
index 1026d682..f8a6b0c4 100644
--- a/src/hb-ft.cc
+++ b/src/hb-ft.cc
@@ -496,8 +496,9 @@ reference_table  (hb_face_t *face HB_UNUSED, hb_tag_t tag, void *user_data)
     return nullptr;
 
   error = FT_Load_Sfnt_Table (ft_face, tag, 0, buffer, &length);
-  if (error) {
-    free ((void*)buffer);
+  if (error)
+  {
+    free (buffer);
     return nullptr;
   }
 
diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc
index 70c9c63c..e40a0e94 100644
--- a/src/hb-ot-shape.cc
+++ b/src/hb-ot-shape.cc
@@ -193,8 +193,9 @@ _hb_ot_shaper_shape_plan_data_create (hb_shape_plan_t    *shape_plan,
 
   if (plan->shaper->data_create) {
     plan->data = plan->shaper->data_create (plan);
-    if (unlikely (!plan->data)) {
-      free ((void*)plan);
+    if (unlikely (!plan->data))
+    {
+      free (plan);
       return nullptr;
     }
   }
commit ecab6604e57ea2bb4e78250a7a400e15b3e86f7a
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed Jul 25 17:37:38 2018 -0700

    [serialize] Allocate for markFilteringSet

diff --git a/src/hb-ot-layout-common-private.hh b/src/hb-ot-layout-common-private.hh
index 7ff0dbeb..dec237c8 100644
--- a/src/hb-ot-layout-common-private.hh
+++ b/src/hb-ot-layout-common-private.hh
@@ -615,6 +615,14 @@ struct Lookup
   inline OffsetArrayOf<SubTableType>& get_subtables (void)
   { return CastR<OffsetArrayOf<SubTableType> > (subTable); }
 
+  inline unsigned int get_size (void) const
+  {
+    const HBUINT16 &markFilteringSet = StructAfter<const HBUINT16> (subTable);
+    if (lookupFlag & LookupFlag::UseMarkFilteringSet)
+      return (const char *) &StructAfter<const char> (markFilteringSet) - (const char *) this;
+    return (const char *) &markFilteringSet - (const char *) this;
+  }
+
   inline unsigned int get_type (void) const { return lookupType; }
 
   /* lookup_props is a 32-bit integer where the lower 16-bit is LookupFlag and
@@ -657,6 +665,7 @@ struct Lookup
     if (unlikely (!subTable.serialize (c, num_subtables))) return_trace (false);
     if (lookupFlag & LookupFlag::UseMarkFilteringSet)
     {
+      if (unlikely (!c->extend (*this))) return_trace (false);
       HBUINT16 &markFilteringSet = StructAfter<HBUINT16> (subTable);
       markFilteringSet.set (lookup_props >> 16);
     }
commit 7f08818c441517f73c5bea0a2a88f494dfc8fa58
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed Jul 25 17:22:05 2018 -0700

    Minor

diff --git a/src/hb-iter-private.hh b/src/hb-iter-private.hh
index a22675cd..410a50f9 100644
--- a/src/hb-iter-private.hh
+++ b/src/hb-iter-private.hh
@@ -50,11 +50,13 @@
 template <typename T>
 struct Iter;
 
+#if 0
 template <typename T>
 struct Iter
 {
-  inline Iter (const T &c);
+  explicit inline Iter (const T &c);
 };
+#endif
 
 template <typename T>
 struct Iter<T *>
@@ -66,7 +68,7 @@ struct Iter<T *>
   inline Iter (T *array_, int length_) :
     array (array_), length (MAX (length_, 0)) {}
   template <unsigned int length_>
-  inline Iter (T (&array_)[length_]) :
+  explicit inline Iter (T (&array_)[length_]) :
     array (array_), length (length_) {}
 
   /* Emptiness. */
@@ -138,7 +140,7 @@ m (void)
 
   s2 = s;
 
-  for (; s && t; s++, t++)
+  for (; s && t; ++s, ++t)
    {
     *t = *s;
    }
diff --git a/src/hb-machinery-private.hh b/src/hb-machinery-private.hh
index 649788c1..653d7c6f 100644
--- a/src/hb-machinery-private.hh
+++ b/src/hb-machinery-private.hh
@@ -400,7 +400,6 @@ struct hb_serialize_context_t
 		     this->start, this->end,
 		     (int) (this->head - this->start),
 		     this->ran_out_of_room ? "RAN OUT OF ROOM" : "did not ran out of room");
-
   }
 
   template <typename Type>
commit 2e25d8f49181ab1d7fda520ae6587d293a982acf
Author: prrace <philip.race at oracle.com>
Date:   Fri Jul 27 13:58:27 2018 -0700

    Fix unlikely leaks

diff --git a/src/hb-ft.cc b/src/hb-ft.cc
index 6670d9a6..1026d682 100644
--- a/src/hb-ft.cc
+++ b/src/hb-ft.cc
@@ -496,8 +496,10 @@ reference_table  (hb_face_t *face HB_UNUSED, hb_tag_t tag, void *user_data)
     return nullptr;
 
   error = FT_Load_Sfnt_Table (ft_face, tag, 0, buffer, &length);
-  if (error)
+  if (error) {
+    free ((void*)buffer);
     return nullptr;
+  }
 
   return hb_blob_create ((const char *) buffer, length,
 			 HB_MEMORY_MODE_WRITABLE,
diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc
index 6696ad88..70c9c63c 100644
--- a/src/hb-ot-shape.cc
+++ b/src/hb-ot-shape.cc
@@ -193,8 +193,10 @@ _hb_ot_shaper_shape_plan_data_create (hb_shape_plan_t    *shape_plan,
 
   if (plan->shaper->data_create) {
     plan->data = plan->shaper->data_create (plan);
-    if (unlikely (!plan->data))
+    if (unlikely (!plan->data)) {
+      free ((void*)plan);
       return nullptr;
+    }
   }
 
   return plan;


More information about the HarfBuzz mailing list