diff --git a/reactos/subsystems/win32/win32k/objects/path.c b/reactos/subsystems/win32/win32k/objects/path.c index c5ad11ff84e..f6903231149 100644 --- a/reactos/subsystems/win32/win32k/objects/path.c +++ b/reactos/subsystems/win32/win32k/objects/path.c @@ -760,8 +760,11 @@ PATH_PolyDraw(PDC dc, const POINT *pts, const BYTE *types, DWORD cbPoints) lastmove.x = orig_pos.x = pdcattr->ptlCurrent.x; lastmove.y = orig_pos.y = pdcattr->ptlCurrent.y; - for (i = pPath->numEntriesUsed - 1; i >= 0; i--) + i = pPath->numEntriesUsed; + + while (i != 0) { + i--; if (pPath->pFlags[i] == PT_MOVETO) { lastmove.x = pPath->pPoints[i].x;