diff options
author | Jeff Muizelaar <jmuizelaar@mozilla.com> | 2009-02-09 23:43:04 -0500 |
---|---|---|
committer | Jeff Muizelaar <jmuizelaar@mozilla.com> | 2009-02-09 23:43:04 -0500 |
commit | fe40d3bdb0d0cb93169b935e44d14b15e014fa6d (patch) | |
tree | ab456182bc6b6aabd49fa0eec3a6aba771c76dad /test/show-glyphs-many.c | |
parent | 50f8c2e4f3407ef237afd94c7317b1e185ccc9dc (diff) | |
download | cairo-fe40d3bdb0d0cb93169b935e44d14b15e014fa6d.tar.gz |
[test] Allocate glyph array with malloc
Keeping it on the stack causes a stack overflow of Window's
default 1mb stack.
Diffstat (limited to 'test/show-glyphs-many.c')
-rw-r--r-- | test/show-glyphs-many.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test/show-glyphs-many.c b/test/show-glyphs-many.c index 7276b0762..497db5845 100644 --- a/test/show-glyphs-many.c +++ b/test/show-glyphs-many.c @@ -109,7 +109,7 @@ get_glyph (cairo_t *cr, const char *utf8, cairo_glyph_t *glyph) static cairo_test_status_t draw (cairo_t *cr, int width, int height) { - cairo_glyph_t glyphs[NUM_GLYPHS]; + cairo_glyph_t *glyphs = malloc(NUM_GLYPHS * sizeof(cairo_glyph_t)); const char *characters[] = { /* try to exercise different widths of index */ "m", /* Latin letter m, index=0x50 */ "μ", /* Greek letter mu, index=0x349 */ @@ -156,6 +156,8 @@ draw (cairo_t *cr, int width, int height) glyphs[j] = glyphs[i]; cairo_show_glyphs (cr, glyphs, NUM_GLYPHS); + + free(glyphs); return CAIRO_TEST_SUCCESS; } |