Fixed crash in font browsing for raster fonts.
This commit is contained in:
parent
4381c62560
commit
60c1ae0bb8
@ -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);
|
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 */
|
/* 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 (di->nFont)
|
||||||
if (idx != di->nFont)
|
{
|
||||||
memmove(&di->font[idx + 1], &di->font[idx], (di->nFont - idx) * sizeof(*di->font));
|
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].height = tm->tmHeight;
|
||||||
di->font[idx].weight = tm->tmWeight;
|
di->font[idx].weight = tm->tmWeight;
|
||||||
lstrcpy(di->font[idx].faceName, lf->lfFaceName);
|
lstrcpy(di->font[idx].faceName, lf->lfFaceName);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user