riched20: Allocate proper amount of memory for formatetc array.

This commit is contained in:
Kevin Koltzau 2006-02-22 23:04:56 -05:00 committed by Alexandre Julliard
parent 6da92ded75
commit c0cd38fbab
1 changed files with 2 additions and 1 deletions

View File

@ -397,10 +397,11 @@ HRESULT ME_GetDataObject(ME_TextEditor *editor, CHARRANGE *lpchrg, LPDATAOBJECT
obj->rtf = NULL;
obj->fmtetc_cnt = 1;
if(editor->mode & TM_RICHTEXT)
obj->fmtetc_cnt++;
obj->fmtetc = HeapAlloc(GetProcessHeap(), 0, obj->fmtetc_cnt*sizeof(FORMATETC));
InitFormatEtc(obj->fmtetc[0], CF_UNICODETEXT, TYMED_HGLOBAL);
if(editor->mode & TM_RICHTEXT) {
obj->fmtetc_cnt++;
obj->rtf = get_rtf_text(editor, lpchrg);
InitFormatEtc(obj->fmtetc[1], cfRTF, TYMED_HGLOBAL);
}