From 40dba5e52642542b8e5312db9018e64d5eca6991 Mon Sep 17 00:00:00 2001 From: Giannis Adamopoulos Date: Thu, 7 Oct 2010 19:14:49 +0000 Subject: [PATCH] [win32k] - Fix an ancient FIXME in PATH_PathToRegion svn path=/trunk/; revision=49039 --- reactos/subsystems/win32/win32k/objects/path.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/reactos/subsystems/win32/win32k/objects/path.c b/reactos/subsystems/win32/win32k/objects/path.c index 21ecb7c442b..04a1314719d 100644 --- a/reactos/subsystems/win32/win32k/objects/path.c +++ b/reactos/subsystems/win32/win32k/objects/path.c @@ -1062,8 +1062,6 @@ PATH_PathToRegion ( PPATH pPath, INT nPolyFillMode, HRGN *pHrgn ) PATH_FlattenPath ( pPath ); - /* FIXME: What happens when number of points is zero? */ - /* First pass: Find out how many strokes there are in the path */ /* FIXME: We could eliminate this with some bookkeeping in GdiPath */ numStrokes=0; @@ -1071,6 +1069,11 @@ PATH_PathToRegion ( PPATH pPath, INT nPolyFillMode, HRGN *pHrgn ) if((pPath->pFlags[i] & ~PT_CLOSEFIGURE) == PT_MOVETO) numStrokes++; + if(numStrokes == 0) + { + return FALSE; + } + /* Allocate memory for number-of-points-in-stroke array */ pNumPointsInStroke = ExAllocatePoolWithTag(PagedPool, sizeof(ULONG) * numStrokes, TAG_PATH); if(!pNumPointsInStroke)