From e8742dddde2c8c829cb5bef6a15988046f6bc68d Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Sun, 20 Feb 2000 13:35:54 +0000 Subject: [PATCH] Check for NULL ptr in PSDRV_GetDeviceCapabilities. --- graphics/psdrv/driver.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/graphics/psdrv/driver.c b/graphics/psdrv/driver.c index 45a23ec14c8..a733988cd38 100644 --- a/graphics/psdrv/driver.c +++ b/graphics/psdrv/driver.c @@ -300,8 +300,16 @@ DWORD WINAPI PSDRV_DeviceCapabilities16(LPCSTR lpszDevice, LPCSTR lpszPort, PRINTERINFO *pi; DEVMODEA *lpdm; pi = PSDRV_FindPrinterInfo(lpszDevice); + TRACE("Cap=%d. Got PrinterInfo = %p\n", fwCapability, pi); + + if (!pi) { + ERR("no printerinfo for %s, return 0!\n",lpszDevice); + return 0; + } + + lpdm = lpDevMode ? lpDevMode : (DEVMODEA *)pi->Devmode; switch(fwCapability) {