riched20: Allocate proper amount of memory for formatetc array.
This commit is contained in:
parent
6da92ded75
commit
c0cd38fbab
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue