projects
/
platform
/
upstream
/
libHarfBuzzSharp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
21bf147
)
[subset] Fix div-by-zero
author
Behdad Esfahbod
<behdad@behdad.org>
Fri, 7 Sep 2018 14:24:22 +0000
(10:24 -0400)
committer
Behdad Esfahbod
<behdad@behdad.org>
Fri, 7 Sep 2018 14:24:22 +0000
(10:24 -0400)
src/hb-subset.cc
patch
|
blob
|
history
diff --git
a/src/hb-subset.cc
b/src/hb-subset.cc
index
adc7c51
..
2bed358
100644
(file)
--- 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));
}