diff --git a/src/autofit/afglobal.c b/src/autofit/afglobal.c index 4092de6ba..87a3fbfb0 100644 --- a/src/autofit/afglobal.c +++ b/src/autofit/afglobal.c @@ -337,11 +337,13 @@ /* we allocate an AF_FaceGlobals structure together */ /* with the glyph_styles array */ - if ( FT_ALLOC( globals, - sizeof ( *globals ) + - (FT_ULong)face->num_glyphs * sizeof ( FT_UShort ) ) ) + if ( FT_QALLOC( globals, + sizeof ( *globals ) + + (FT_ULong)face->num_glyphs * sizeof ( FT_UShort ) ) ) goto Exit; + FT_ZERO( &globals->metrics ); + globals->face = face; globals->glyph_count = face->num_glyphs; /* right after the globals structure come the glyph styles */