Skip to content

Commit

Permalink
Dont ignore errors from FT_Get_Glyph
Browse files Browse the repository at this point in the history
"image" is left uninitialized if we do.

Reviewed By: @scannell

Differential Revision: D1126277
  • Loading branch information
mwilliams authored and sgolemon committed Jan 14, 2014
1 parent 42795f0 commit 7eb3262
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion hphp/runtime/ext/gd/libgd/gdft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1050,7 +1050,14 @@ 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;
Expand Down

0 comments on commit 7eb3262

Please sign in to comment.