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:
9897749
)
Fix stupid array growing bug
author
Behdad Esfahbod
<behdad@behdad.org>
Fri, 28 Aug 2009 13:46:14 +0000
(09:46 -0400)
committer
Behdad Esfahbod
<behdad@behdad.org>
Mon, 2 Nov 2009 19:40:47 +0000
(14:40 -0500)
src/hb-ot-layout.cc
patch
|
blob
|
history
diff --git
a/src/hb-ot-layout.cc
b/src/hb-ot-layout.cc
index c8d2d2c761889afdb212f90f5d81a9e68acfed0a..3b6b8dae4b22a0f315c246e6549d5b60f3ff709f 100644
(file)
--- a/
src/hb-ot-layout.cc
+++ b/
src/hb-ot-layout.cc
@@
-222,10
+222,13
@@
_hb_ot_layout_set_glyph_class (hb_face_t *face,
/* XXX this is not threadsafe */
if (glyph >= len) {
- int new_len;
+
unsigned
int new_len;
unsigned char *new_klasses;
new_len = len == 0 ? 120 : 2 * len;
+ while (new_len <= glyph)
+ new_len *= 2;
+
if (new_len > 65536)
new_len = 65536;
new_klasses = (unsigned char *) realloc (layout->new_gdef.klasses, new_len * sizeof (unsigned char));