From 473d6cbd274cb7f6e2091db6c04402afb7214f68 Mon Sep 17 00:00:00 2001 From: Steve Lustbader Date: Mon, 25 Nov 2002 01:10:04 +0000 Subject: [PATCH] StretchDIBits: avoid crash on null pointers. --- objects/dib.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/objects/dib.c b/objects/dib.c index 1a734e40239..3119ac9f04e 100644 --- a/objects/dib.c +++ b/objects/dib.c @@ -155,9 +155,14 @@ INT WINAPI StretchDIBits(HDC hdc, INT xDst, INT yDst, INT widthDst, INT heightSrc, const void *bits, const BITMAPINFO *info, UINT wUsage, DWORD dwRop ) { - DC *dc = DC_GetDCUpdate( hdc ); - if(!dc) return FALSE; + DC *dc; + if (!bits || !info) + return 0; + + dc = DC_GetDCUpdate( hdc ); + if(!dc) return FALSE; + if(dc->funcs->pStretchDIBits) { heightSrc = dc->funcs->pStretchDIBits(dc->physDev, xDst, yDst, widthDst,