diff --git a/reactos/subsys/win32k/eng/bitblt.c b/reactos/subsys/win32k/eng/bitblt.c index 91ba8835bb1..c582ebf678d 100644 --- a/reactos/subsys/win32k/eng/bitblt.c +++ b/reactos/subsys/win32k/eng/bitblt.c @@ -128,6 +128,14 @@ EngBitBlt(SURFOBJ *Dest, } } + /* The code currently assumes there will be a source bitmap. This is not true when, for example, using this function to + * paint a brush pattern on the destination. */ + if(!Source) + { + DbgPrint("EngBitBlt: A source is currently required, even though not all operations require one (FIXME)\n"); + return FALSE; + } + // * The source bitmap is not managed by the GDI and we didn't already obtain it using EngCopyBits from the device if(Source->iType != STYPE_BITMAP && SourceGDI->CopyBits == NULL) { diff --git a/reactos/subsys/win32k/objects/fillshap.c b/reactos/subsys/win32k/objects/fillshap.c index a7f10517dc0..0e06ee26445 100644 --- a/reactos/subsys/win32k/objects/fillshap.c +++ b/reactos/subsys/win32k/objects/fillshap.c @@ -134,26 +134,30 @@ W32kRectangle(HDC hDC, RectBounds, // Bounding rectangle dc->w.ROPmode); // MIX */ + // FIXME: BrushObj is obtained above; decide which one is correct BrushObj = (BRUSHOBJ*) GDIOBJ_LockObj(dc->w.hBrush, GO_BRUSH_MAGIC); - assert(BrushObj); - if (BrushObj->logbrush.lbStyle != BS_NULL) - { - DestRect.left = LeftRect + 1; - DestRect.right = RightRect - 1; - DestRect.top = TopRect + 1; - DestRect.bottom = BottomRect - 1; - ret = EngBitBlt(SurfObj, - NULL, - NULL, - NULL, - NULL, - &DestRect, - NULL, - NULL, - BrushObj, - NULL, - PATCOPY); - } + + if (BrushObj) + { + if (BrushObj->logbrush.lbStyle != BS_NULL) + { + DestRect.left = LeftRect + 1; + DestRect.right = RightRect - 1; + DestRect.top = TopRect + 1; + DestRect.bottom = BottomRect - 1; + ret = EngBitBlt(SurfObj, + NULL, + NULL, + NULL, + NULL, + &DestRect, + NULL, + NULL, + BrushObj, + NULL, + PATCOPY); + } + } GDIOBJ_UnlockObj( dc->w.hBrush, GO_PEN_MAGIC ); }