From: Gregor Schneider Date: Sun, 16 Aug 2009 19:20:50 +0000 (+0000) Subject: Allocate span memory for every clipping type, not only for one X-Git-Tag: ReactOS-0.3.11~1138 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=d9bc76c65a1d98abbd0785af306b3501d58b9aa3;ds=sidebyside Allocate span memory for every clipping type, not only for one svn path=/trunk/; revision=42741 --- diff --git a/reactos/subsystems/win32/win32k/eng/clip.c b/reactos/subsystems/win32/win32k/eng/clip.c index d3a97f25108..b5453cd63a6 100644 --- a/reactos/subsystems/win32/win32k/eng/clip.c +++ b/reactos/subsystems/win32/win32k/eng/clip.c @@ -406,18 +406,21 @@ ClipobjToSpans( ASSERT(Boundary->top <= Boundary->bottom && Boundary->left <= Boundary->right); - *Spans = NULL; + *Count = Boundary->bottom - Boundary->top; + if (*Count > 0) + { + *Spans = ExAllocatePoolWithTag(PagedPool, *Count * sizeof(SPAN), TAG_CLIP); + if (NULL == *Spans) + { + *Count = 0; + return FALSE; + } + } + if (NULL == ClipRegion || DC_TRIVIAL == ClipRegion->iDComplexity) { - *Count = Boundary->bottom - Boundary->top; if (0 != *Count) { - *Spans = ExAllocatePoolWithTag(PagedPool, *Count * sizeof(SPAN), TAG_CLIP); - if (NULL == *Spans) - { - *Count = 0; - return FALSE; - } for (i = 0; i < Boundary->bottom - Boundary->top; i++) { (*Spans)[i].X = Boundary->left;