com php-src: Dont ignore errors from FT_Get_Glyph: ext/ gd/libgd/gdft.c
| From: | Christoph Michael Becker | Date: | Sun, 03 Apr 2016 10:11:25 +0000 |
| Subject: | com php-src: Dont ignore errors from FT_Get_Glyph: ext/ gd/libgd/gdft.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-94596@lists.php.net to get a copy of this message | ||
Commit: 9f25f736ed50a2dc94aeff4f289c1a5e26fc6a40
Author: Paul Tarjan <ptarjan@php.net> Mon, 13 Jan 2014 16:30:48 -0800
Committer: Mark Plomer <mail@mark-plomer.de> Sun, 3 Apr 2016 12:11:25 +0200
Parents: a00c2b1bf54fb09015321e3677d89da552938306
Branches: PHP-5.6 PHP-7.0 PHP-7.1 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9f25f736ed50a2dc94aeff4f289c1a5e26fc6a40
Log:
Dont ignore errors from FT_Get_Glyph
Changed paths:
M ext/gd/libgd/gdft.c
Diff:
diff --git a/ext/gd/libgd/gdft.c b/ext/gd/libgd/gdft.c
index ba905dc..763efcf 100644
--- a/ext/gd/libgd/gdft.c
+++ b/ext/gd/libgd/gdft.c
@@ -1089,7 +1089,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;