From: Paul Tarjan Date: Tue, 14 Jan 2014 00:30:48 +0000 (-0800) Subject: Dont ignore errors from FT_Get_Glyph X-Git-Tag: PRE_PHPNG_MERGE~388^2~62 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d599d36d49fb51cc0b373493ef2ebdab34699c4c;p=php Dont ignore errors from FT_Get_Glyph --- diff --git a/ext/gd/libgd/gdft.c b/ext/gd/libgd/gdft.c index ac2bf344ff..aa8e8d3a74 100644 --- a/ext/gd/libgd/gdft.c +++ b/ext/gd/libgd/gdft.c @@ -1050,7 +1050,15 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsi } /* transform glyph image */ - FT_Get_Glyph(slot, &image); + if (FT_Get_Glyph(slot, &image)) { + if (tmpstr) { + gdFree(tmpstr); + } + gdCacheDelete(tc_cache); + gdMutexUnlock(gdFontCacheMutex); + return "Problem loading glyph"; + } + if (brect) { /* only if need brect */ FT_Glyph_Get_CBox(image, ft_glyph_bbox_gridfit, &glyph_bbox); glyph_bbox.xMin += penf.x;