Commit c0cd38fb authored by Kevin Koltzau's avatar Kevin Koltzau Committed by Alexandre Julliard

riched20: Allocate proper amount of memory for formatetc array.

parent 6da92ded
......@@ -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);
}
......
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