richedit: Prevent integer overflow in wrapping code with no wrap.

This commit is contained in:
Dylan Smith 2008-08-29 16:03:51 -04:00 committed by Alexandre Julliard
parent f3c071660d
commit b5e9aed268

View file

@ -377,7 +377,7 @@ static ME_DisplayItem *ME_WrapHandleRun(ME_WrapContext *wc, ME_DisplayItem *p)
}
/* will current run fit? */
if (wc->pt.x + run->nWidth > wc->context->pt.x + wc->nAvailWidth)
if (wc->pt.x + run->nWidth - wc->context->pt.x > wc->nAvailWidth)
{
int loc = wc->context->pt.x + wc->nAvailWidth - wc->pt.x;
/* total white run ? */