Ouch, fix buffer

This commit is contained in:
Behdad Esfahbod 2014-07-24 15:34:20 -04:00
parent aeba5bf4b6
commit 76151ceaf3
1 changed files with 2 additions and 2 deletions

View File

@ -829,7 +829,7 @@ FcSfntNameTranscode (FT_SfntName *sname)
*u8 = '\0'; *u8 = '\0';
goto done; goto done;
} }
if (!strcmp (fromcode, "MACINTOSH")) if (!strcmp (fromcode, FC_ENCODING_MAC_ROMAN))
{ {
FcChar8 *src = sname->string; FcChar8 *src = sname->string;
int src_len = sname->string_len; int src_len = sname->string_len;
@ -840,7 +840,7 @@ FcSfntNameTranscode (FT_SfntName *sname)
/* /*
* Convert Latin1 to Utf8. Freed below * Convert Latin1 to Utf8. Freed below
*/ */
utf8 = malloc (src_len + 1); utf8 = malloc (src_len * 3 + 1);
if (!utf8) if (!utf8)
return 0; return 0;