mirror of
https://github.com/reactos/reactos.git
synced 2024-12-26 17:14:41 +00:00
[NTGDI] Prevent NULL pointer dereference in CLIPPING_UpdateGCRegion
This can happen, when the paged pool is full. This will probably cause drawing issues, but at least we don't crash (in this place).
This commit is contained in:
parent
299e4305ef
commit
9414fb6b59
1 changed files with 20 additions and 7 deletions
|
@ -11,6 +11,8 @@
|
|||
#define NDEBUG
|
||||
#include <debug.h>
|
||||
|
||||
DBG_DEFAULT_CHANNEL(GdiClipRgn);
|
||||
|
||||
VOID
|
||||
FASTCALL
|
||||
IntGdiReleaseRaoRgn(PDC pDC)
|
||||
|
@ -776,16 +778,16 @@ CLIPPING_UpdateGCRegion(PDC pDC)
|
|||
pDC->prgnAPI = NULL;
|
||||
}
|
||||
|
||||
if (pDC->prgnRao)
|
||||
REGION_Delete(pDC->prgnRao);
|
||||
|
||||
pDC->prgnRao = IntSysCreateRectpRgn(0,0,0,0);
|
||||
|
||||
ASSERT(pDC->prgnRao);
|
||||
|
||||
if (pDC->dclevel.prgnMeta || pDC->dclevel.prgnClip)
|
||||
{
|
||||
pDC->prgnAPI = IntSysCreateRectpRgn(0,0,0,0);
|
||||
if (!pDC->prgnAPI)
|
||||
{
|
||||
/* Best we can do here. Better than crashing. */
|
||||
ERR("Failed to allocate prgnAPI! Expect drawing issues!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!pDC->dclevel.prgnMeta)
|
||||
{
|
||||
REGION_bCopy(pDC->prgnAPI,
|
||||
|
@ -804,6 +806,17 @@ CLIPPING_UpdateGCRegion(PDC pDC)
|
|||
}
|
||||
}
|
||||
|
||||
if (pDC->prgnRao)
|
||||
REGION_Delete(pDC->prgnRao);
|
||||
|
||||
pDC->prgnRao = IntSysCreateRectpRgn(0,0,0,0);
|
||||
if (!pDC->prgnRao)
|
||||
{
|
||||
/* Best we can do here. Better than crashing. */
|
||||
ERR("Failed to allocate prgnRao! Expect drawing issues!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (pDC->prgnAPI)
|
||||
{
|
||||
REGION_bIntersectRegion(pDC->prgnRao,
|
||||
|
|
Loading…
Reference in a new issue