]> granicus.if.org Git - php/commitdiff
Dont ignore errors from FT_Get_Glyph
authorPaul Tarjan <ptarjan@php.net>
Tue, 14 Jan 2014 00:30:48 +0000 (16:30 -0800)
committerPaul Tarjan <ptarjan@php.net>
Tue, 14 Jan 2014 00:30:48 +0000 (16:30 -0800)
ext/gd/libgd/gdft.c

index ac2bf344ffecf2ce5eb6e873b71c4639eef9fe1c..aa8e8d3a74a47350848df88e1460e99d7eaf8e38 100644 (file)
@@ -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;