Commit b5e9aed2 authored by Dylan Smith's avatar Dylan Smith Committed by Alexandre Julliard

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

parent f3c07166
......@@ -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 ? */
......
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