From 9766e56248eb82b4702ffc552ee93804bd3d31ca Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Tue, 18 Sep 2012 22:01:38 +0000 Subject: [PATCH] [WIN32K] make sure at least one rect is allocated in REGION_PtsToRegion. Fixes failed assertion when starting pacman4000 (the game itself doesn't work though) CORE-5431 #resolve svn path=/trunk/; revision=57329 --- reactos/win32ss/gdi/ntgdi/region.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reactos/win32ss/gdi/ntgdi/region.c b/reactos/win32ss/gdi/ntgdi/region.c index f6f341e145a..19851fbd262 100644 --- a/reactos/win32ss/gdi/ntgdi/region.c +++ b/reactos/win32ss/gdi/ntgdi/region.c @@ -2911,6 +2911,12 @@ REGION_PtsToRegion( numRects = ((numFullPtBlocks * NUMPTSTOBUFFER) + iCurPtBlock) >> 1; + /* Make sure, we have at least one rect */ + if (numRects == 0) + { + numRects = 1; + } + if (!(temp = ExAllocatePoolWithTag(PagedPool, numRects * sizeof(RECT), TAG_REGION))) { return 0;