Commit 60c1ae0b authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

Fixed crash in font browsing for raster fonts.

parent 4381c625
......@@ -393,9 +393,14 @@ static int CALLBACK font_enum_size(const LOGFONT* lf, const TEXTMETRIC* tm,
SendDlgItemMessage(di->hDlg, IDC_FNT_LIST_SIZE, LB_INSERTSTRING, idx, (LPARAM)buf);
/* now grow our arrays and insert the values at the same index than in the list box */
di->font = HeapReAlloc(GetProcessHeap(), 0, di->font, sizeof(*di->font) * (di->nFont + 1));
if (idx != di->nFont)
memmove(&di->font[idx + 1], &di->font[idx], (di->nFont - idx) * sizeof(*di->font));
if (di->nFont)
{
di->font = HeapReAlloc(GetProcessHeap(), 0, di->font, sizeof(*di->font) * (di->nFont + 1));
if (idx != di->nFont)
memmove(&di->font[idx + 1], &di->font[idx], (di->nFont - idx) * sizeof(*di->font));
}
else
di->font = HeapAlloc(GetProcessHeap(), 0, sizeof(*di->font));
di->font[idx].height = tm->tmHeight;
di->font[idx].weight = tm->tmWeight;
lstrcpy(di->font[idx].faceName, lf->lfFaceName);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment