[HarfBuzz] harfbuzz: Branch 'master'

Behdad Esfahbod behdad at kemper.freedesktop.org
Fri Sep 7 14:24:45 UTC 2018


 src/hb-subset.cc |    3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 5f17dbc3025093308d2191a4abd2eec24db35c0e
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Fri Sep 7 10:24:22 2018 -0400

    [subset] Fix div-by-zero

diff --git a/src/hb-subset.cc b/src/hb-subset.cc
index adc7c51d..2bed3586 100644
--- a/src/hb-subset.cc
+++ b/src/hb-subset.cc
@@ -51,6 +51,9 @@ _plan_estimate_subset_table_size (hb_subset_plan_t *plan,
   unsigned int src_glyphs = plan->source->get_num_glyphs ();
   unsigned int dst_glyphs = plan->glyphset->get_population ();
 
+  if (unlikely (!src_glyphs))
+    return 512 + table_len;
+
   return 512 + (unsigned int) (table_len * sqrt ((double) dst_glyphs / src_glyphs));
 }
 


More information about the HarfBuzz mailing list