diff --git "a/dll/win32/riched20/para.c" "b/dll/win32/riched20/para.c" index 1ba2a7ac541..8de8ad296a7 100644 --- "a/dll/win32/riched20/para.c" +++ "b/dll/win32/riched20/para.c" @@ -494,8 +494,13 @@ static BOOL ME_SetParaFormat(ME_TextEditor *editor, ME_Paragraph *para, const PA COPY_FIELD(PFM_ALIGNMENT, wAlignment); if (dwMask & PFM_TABSTOPS) { +#ifdef __REACTOS__ + para->fmt.cTabCount = max(0, min(pFmt->cTabCount, MAX_TAB_STOPS)); /* Clamp between 0 and MAX_TAB_STOPS */ + memcpy(para->fmt.rgxTabs, pFmt->rgxTabs, para->fmt.cTabCount*sizeof(LONG)); +#else para->fmt.cTabCount = pFmt->cTabCount; memcpy(para->fmt.rgxTabs, pFmt->rgxTabs, pFmt->cTabCount*sizeof(LONG)); +#endif } #define EFFECTS_MASK (PFM_RTLPARA|PFM_KEEP|PFM_KEEPNEXT|PFM_PAGEBREAKBEFORE| \